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

22 lines
415 B
Ruby

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