1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb

23 lines
415 B
Ruby
Raw Normal View History

2010-07-27 23:38:26 -04:00
module ActionDispatch
class BestStandardsSupport
def initialize(app, type = true)
2010-07-27 23:38:26 -04:00
@app = app
@header = case type
when true
"IE=Edge,chrome=1"
when :builtin
"IE=Edge"
when false
nil
end
2010-07-27 23:38:26 -04:00
end
def call(env)
status, headers, body = @app.call(env)
headers["X-UA-Compatible"] = @header
2010-07-27 23:38:26 -04:00
[status, headers, body]
end
end
end