1

我需要以这种方式提供 .crx 文件:

1) The file has the content type application/x-chrome-extension
2) The file is not served with the HTTP header X-Content-Type-Options: nosniff
3) The file is served with one of the following content types:
- "text/plain"
- "application/octet-stream"
- "unknown/unknown"
- "application/unknown"

我必须如何设置我的 .htaccess 文件才能做到这一点?

4

1 回答 1

-1

第 1 条和第 3 条相互矛盾。最简单的方法是将其重命名为.php并使用:

<? 
header('Content-Type: application/x-chrome-extension'); 
?>
...original-file-contents...

我认为您不需要 .crx 扩展名。如果由于某种原因你这样做,你可以使用file.php/fake.crx而不是只是file.php.

于 2012-05-25T17:08:09.930 回答