aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-08-09 11:48:31 -0700
committerwycats <wycats@gmail.com>2010-08-09 11:48:31 -0700
commit6767946374353f90ce05e68d38bcb93dcb8bae56 (patch)
tree28b22ee479c89292bc8c6c1fe604ece36a716beb /actionpack
parent4f7565c4de1f877547a6b901a8416b18c613acc9 (diff)
downloadrails-6767946374353f90ce05e68d38bcb93dcb8bae56.tar.gz
rails-6767946374353f90ce05e68d38bcb93dcb8bae56.tar.bz2
rails-6767946374353f90ce05e68d38bcb93dcb8bae56.zip
Improve best_standards_support to use only IE=Edge in development mode
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/middleware/best_standards_support.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/best_standards_support.rb b/actionpack/lib/action_dispatch/middleware/best_standards_support.rb
index df8f7766bb..69adcc419f 100644
--- a/actionpack/lib/action_dispatch/middleware/best_standards_support.rb
+++ b/actionpack/lib/action_dispatch/middleware/best_standards_support.rb
@@ -1,12 +1,21 @@
module ActionDispatch
class BestStandardsSupport
- def initialize(app)
+ 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"] = "IE=Edge,chrome=1"
+ headers["X-UA-Compatible"] = @header
[status, headers, body]
end
end