Permalink
Browse files

Add 'X-UA-Compatible' => 'chrome=1' to default headers

  • Loading branch information...
1 parent 3bccd12 commit 54a90a4794faed70c9da0d861b94add31391075c @guilleiguaran guilleiguaran committed Jan 29, 2013
Showing with 5 additions and 2 deletions.
  1. +2 −1 actionpack/lib/action_dispatch/railtie.rb
  2. +3 −1 actionpack/test/dispatch/response_test.rb
@@ -20,7 +20,8 @@ class Railtie < Rails::Railtie # :nodoc:
config.action_dispatch.default_headers = {
'X-Frame-Options' => 'SAMEORIGIN',
'X-XSS-Protection' => '1; mode=block',
- 'X-Content-Type-Options' => 'nosniff'
+ 'X-Content-Type-Options' => 'nosniff',
+ 'X-UA-Compatible' => 'chrome=1'
}
config.eager_load_namespaces << ActionDispatch
@@ -182,7 +182,8 @@ def test_response_body_encoding
ActionDispatch::Response.default_headers = {
'X-Frame-Options' => 'DENY',
'X-Content-Type-Options' => 'nosniff',
- 'X-XSS-Protection' => '1;'
+ 'X-XSS-Protection' => '1;',
+ 'X-UA-Compatible' => 'chrome=1'
}
resp = ActionDispatch::Response.new.tap { |response|
response.body = 'Hello'
@@ -192,6 +193,7 @@ def test_response_body_encoding
assert_equal('DENY', resp.headers['X-Frame-Options'])
assert_equal('nosniff', resp.headers['X-Content-Type-Options'])
assert_equal('1;', resp.headers['X-XSS-Protection'])
+ assert_equal('chrome=1', resp.headers['X-UA-Compatible'])
ensure
ActionDispatch::Response.default_headers = nil
end

0 comments on commit 54a90a4

Please sign in to comment.