aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2013-04-22 04:33:50 -0700
committerAndrew White <andyw@pixeltrix.co.uk>2013-04-22 04:33:50 -0700
commit8758c6c6e31162b87ca6b9a43e7f2a91cc3ad2d3 (patch)
tree824a1563a7d7123a262c0f1a102d211c2b6e5a7f /actionpack
parent07acf7b13d98eb8e3dc6628952ca908a020bbdce (diff)
parent5fe68292c2ae46fed868b53fff04396e0f465019 (diff)
downloadrails-8758c6c6e31162b87ca6b9a43e7f2a91cc3ad2d3.tar.gz
rails-8758c6c6e31162b87ca6b9a43e7f2a91cc3ad2d3.tar.bz2
rails-8758c6c6e31162b87ca6b9a43e7f2a91cc3ad2d3.zip
Merge pull request #10297 from vipulnsward/dont_mutate_in_rack_response
extract no content response codes to a constant
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/http/response.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb
index 06e936cdb0..60a2cccdc5 100644
--- a/actionpack/lib/action_dispatch/http/response.rb
+++ b/actionpack/lib/action_dispatch/http/response.rb
@@ -55,6 +55,7 @@ module ActionDispatch # :nodoc:
CONTENT_TYPE = "Content-Type".freeze
SET_COOKIE = "Set-Cookie".freeze
LOCATION = "Location".freeze
+ NO_CONTENT_CODES = [204, 304]
cattr_accessor(:default_charset) { "utf-8" }
cattr_accessor(:default_headers)
@@ -289,7 +290,7 @@ module ActionDispatch # :nodoc:
header[SET_COOKIE] = header[SET_COOKIE].join("\n") if header[SET_COOKIE].respond_to?(:join)
- if [204, 304].include?(@status)
+ if NO_CONTENT_CODES.include?(@status)
header.delete CONTENT_TYPE
[status, header, []]
else