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

This commit is contained in:
Guillermo Iguaran 2013-01-29 14:55:03 -05:00
parent 3bccd12373
commit 54a90a4794
2 changed files with 5 additions and 2 deletions

@ -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