Skip to content

Commit

Permalink
Improve comment for 'nosniff' header
Browse files Browse the repository at this point in the history
- Reworded the part about IE8 second-guessing content type
- Added a note about Flash, as per Mathias Karlsson's recommendation in
  issue #17874
  • Loading branch information
dregad committed Dec 5, 2014
1 parent 26f209a commit dfe664a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions core/http_api.php
Expand Up @@ -132,8 +132,8 @@ function http_caching_headers( $p_allow_caching = false ) {
function http_content_headers() {
if( !headers_sent() ) {
header( 'Content-Type: text/html; charset=UTF-8' );
# Disallow Internet Explorer from attempting to second guess the Content-Type
# header as per http://blogs.msdn.com/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
# Don't let Internet Explorer second-guess our content-type, as per
# http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
header( 'X-Content-Type-Options: nosniff' );
}
}
Expand Down
4 changes: 2 additions & 2 deletions css/common_config.php
Expand Up @@ -36,8 +36,8 @@
header( 'Content-Type: text/css; charset=UTF-8' );

/**
* Disallow Internet Explorer from attempting to second guess the Content-Type
* header as per http://blogs.msdn.com/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
* Don't let Internet Explorer second-guess our content-type, as per
* http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
*/
header( 'X-Content-Type-Options: nosniff' );

Expand Down
4 changes: 2 additions & 2 deletions css/status_config.php
Expand Up @@ -34,8 +34,8 @@
header( 'Content-Type: text/css; charset=UTF-8' );

/**
* Disallow Internet Explorer from attempting to second guess the Content-Type
* header as per http://blogs.msdn.com/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
* Don't let Internet Explorer second-guess our content-type, as per
* http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
*/
header( 'X-Content-Type-Options: nosniff' );

Expand Down
6 changes: 4 additions & 2 deletions file_download.php
Expand Up @@ -192,8 +192,10 @@
header( 'Content-Type: ' . $t_content_type );
header( 'Content-Length: ' . $v_filesize );

# For Internet Explorer 8 as per http://blogs.msdn.com/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
# Don't let IE second guess our content-type!
# Don't let Internet Explorer second-guess our content-type [1]
# Also disable Flash content-type sniffing [2]
# [1] http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
# [2] http://50.56.33.56/blog/?p=242
header( 'X-Content-Type-Options: nosniff' );

# dump file content to the connection.
Expand Down
4 changes: 2 additions & 2 deletions javascript_config.php
Expand Up @@ -41,8 +41,8 @@ function print_config_value( $p_config_key ) {
header( 'Content-Type: application/javascript; charset=UTF-8' );


# Disallow Internet Explorer from attempting to second guess the Content-Type
# header as per http://blogs.msdn.com/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
# Don't let Internet Explorer second-guess our content-type, as per
# http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
header( 'X-Content-Type-Options: nosniff' );


Expand Down
4 changes: 2 additions & 2 deletions javascript_translations.php
Expand Up @@ -42,8 +42,8 @@ function print_translation( $p_lang_key ) {
# application/javasscript is the correct MIME type.
header( 'Content-Type: application/javascript; charset=UTF-8' );

# Disallow Internet Explorer from attempting to second guess the Content-Type
# header as per http://blogs.msdn.com/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
# Don't let Internet Explorer second-guess our content-type, as per
# http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
header( 'X-Content-Type-Options: nosniff' );

echo "var translations = new Array();\n";
Expand Down

0 comments on commit dfe664a

Please sign in to comment.