Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #8914 from nilbus/fix-header-bloat

Remove header bloat introduced by BestStandardsSupport middleware
Conflicts:
	actionpack/CHANGELOG.md
  • Loading branch information...
commit 9669aa7cf1c50964c4729fbd50a8776a1e815b44 1 parent 63970dc
@rafaelfranca rafaelfranca authored
View
5 actionpack/CHANGELOG.md
@@ -1,5 +1,10 @@
## Rails 3.2.12 (unreleased) ##
+* `BestStandardsSupport` no longer duplicates `X-UA-Compatible` values on
+ each request to prevent header size from blowing up.
+
+ *Edward Anderson*
+
* Fixed JSON params parsing regression for non-object JSON content.
*Dylan Smith*
View
4 actionpack/lib/action_dispatch/middleware/best_standards_support.rb
@@ -17,7 +17,9 @@ def call(env)
status, headers, body = @app.call(env)
if headers["X-UA-Compatible"] && @header
- headers["X-UA-Compatible"] << "," << @header.to_s
+ unless headers["X-UA-Compatible"][@header]
+ headers["X-UA-Compatible"] << "," << @header.to_s
+ end
else
headers["X-UA-Compatible"] = @header
end
View
3  actionpack/test/dispatch/best_standards_support_test.rb
@@ -16,9 +16,10 @@ def test_without_best_standards_support
assert_equal nil, headers["X-UA-Compatible"]
end
- def test_appends_to_app_headers
+ def test_appends_to_app_headers_without_duplication_after_multiple_requests
app_headers = { "X-UA-Compatible" => "requiresActiveX=true" }
_, headers, _ = app(true, app_headers).call({})
+ _, headers, _ = app(true, app_headers).call({})
expects = "requiresActiveX=true,IE=Edge,chrome=1"
assert_equal expects, headers["X-UA-Compatible"]

0 comments on commit 9669aa7

Please sign in to comment.
Something went wrong with that request. Please try again.