mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add a header that tells Internet Explorer (all versions) to use the best available standards support. This ensures that IE doesn't go into quirks mode because it has been blacklisted by too many users pressing the incompatible button. It also tells IE to use the ChromeFrame renderer, if the user has installed the plugin.
This guarantees that the best available standards support will be used on the client.
This commit is contained in:
parent
e17e08efef
commit
123eb25fd1
6 changed files with 7 additions and 3 deletions
|
@ -47,6 +47,7 @@ module ActionDispatch
|
|||
end
|
||||
|
||||
autoload_under 'middleware' do
|
||||
autoload :BestStandardsSupport
|
||||
autoload :Callbacks
|
||||
autoload :Cookies
|
||||
autoload :Flash
|
||||
|
|
|
@ -7,10 +7,11 @@ module ActionDispatch
|
|||
config.action_dispatch.x_sendfile_header = ""
|
||||
config.action_dispatch.ip_spoofing_check = true
|
||||
config.action_dispatch.show_exceptions = true
|
||||
config.action_dispatch.best_standards_support = true
|
||||
|
||||
# Prepare dispatcher callbacks and run 'prepare' callbacks
|
||||
initializer "action_dispatch.prepare_dispatcher" do |app|
|
||||
ActionDispatch::Callbacks.to_prepare { app.routes_reloader.execute_if_updated }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -205,6 +205,7 @@ module Rails
|
|||
middleware.use ::ActionDispatch::ParamsParser
|
||||
middleware.use ::Rack::MethodOverride
|
||||
middleware.use ::ActionDispatch::Head
|
||||
middleware.use ::ActionDispatch::BestStandardsSupport if config.action_dispatch.best_standards_support
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -70,4 +70,4 @@ In addition to those, there are:
|
|||
|
||||
All commands can be run with -h for more information.
|
||||
EOT
|
||||
end
|
||||
end
|
||||
|
|
|
@ -50,4 +50,4 @@ module Rails
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -40,6 +40,7 @@ module ApplicationTests
|
|||
|
||||
get '/foo'
|
||||
assert_equal 'foo', last_response.body
|
||||
assert_equal "IE=Edge,chrome=1", last_response.headers["X-UA-Compatible"]
|
||||
end
|
||||
|
||||
test "simple controller with helper" do
|
||||
|
|
Loading…
Reference in a new issue