aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikac.hu>2014-02-28 19:39:22 -0500
committerPrem Sichanugrist <s@sikac.hu>2014-03-05 10:33:52 -0500
commited88a601f7b37de0f89b64249aaeed884faed836 (patch)
treeb1414652556db81876b51138070ba25bd088f07b /actionpack/lib/action_dispatch
parent058d3c6183ef6e0e878bea37f4fe3f8f0d6758e2 (diff)
downloadrails-ed88a601f7b37de0f89b64249aaeed884faed836.tar.gz
rails-ed88a601f7b37de0f89b64249aaeed884faed836.tar.bz2
rails-ed88a601f7b37de0f89b64249aaeed884faed836.zip
Do note remove `Content-Type` when `render :body`
`render :body` should just not set the `Content-Type` header. By removing the header, it breaks the compatibility with other parts. After this commit, `render :body` will returns `text/html` content type, sets by default from `ActionDispatch::Response`, and it will preserve the overridden content type if you override it. Fixes #14197, #14238 This partially reverts commit 3047376870d4a7adc7ff15c3cb4852e073c8f1da.
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/http/response.rb13
1 files changed, 1 insertions, 12 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb
index f14ca1ea44..2c6bcf7b7b 100644
--- a/actionpack/lib/action_dispatch/http/response.rb
+++ b/actionpack/lib/action_dispatch/http/response.rb
@@ -63,8 +63,6 @@ module ActionDispatch # :nodoc:
# content you're giving them, so we need to send that along.
attr_accessor :charset
- attr_accessor :no_content_type # :nodoc:
-
CONTENT_TYPE = "Content-Type".freeze
SET_COOKIE = "Set-Cookie".freeze
LOCATION = "Location".freeze
@@ -305,17 +303,8 @@ module ActionDispatch # :nodoc:
!@sending_file && @charset != false
end
- def remove_content_type!
- headers.delete CONTENT_TYPE
- end
-
def rack_response(status, header)
- if no_content_type
- remove_content_type!
- else
- assign_default_content_type_and_charset!(header)
- end
-
+ assign_default_content_type_and_charset!(header)
handle_conditional_get!
header[SET_COOKIE] = header[SET_COOKIE].join("\n") if header[SET_COOKIE].respond_to?(:join)