diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-18 11:46:12 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-18 11:46:12 -0800 |
commit | e5e440f477a0b5e06b008ee77e3c635049405957 (patch) | |
tree | 3e26bbc11329439e75495fafa5688e9f814bdf31 /actionpack/lib/action_dispatch/http | |
parent | 20fd254a5bdf35347d231dcc44d7b94cc5c00c1e (diff) | |
parent | 5dc6bf5fbcb70b330edff8da257607acd1760805 (diff) | |
download | rails-e5e440f477a0b5e06b008ee77e3c635049405957.tar.gz rails-e5e440f477a0b5e06b008ee77e3c635049405957.tar.bz2 rails-e5e440f477a0b5e06b008ee77e3c635049405957.zip |
Merge branch 'master' into adequaterecord
* master: (32 commits)
Typo fix for unscope
Use the reference for the mime type to get the format
Preparing for 4.1.0.beta2 release
Correctly escape PostgreSQL arrays.
Escape format, negative_format and units options of number helpers
Sync 4.1 release notes with changes since 7f648bc7 [ci skip]
Update upgrading guide regarding `render :text`
Add `#no_content_type` attribute to `AD::Response`
Add missing CHANGELOG entry to Action View
Update guides for new rendering options
Cleanup `ActionController::Rendering`
Fix a fragile test on `action_view/render`
Introduce `render :html` for render HTML string
Introduce `render :plain` for render plain text
Update hash format for render_text_test
Introduce `render :body` for render raw content
Don't use `# =>` when it is not the expression values
Fix the column name [ci skip]
Document the default scopes change on the release notes, CHANGELOG and upgrating guides
Move changelog entry to the top, fix examples indent [ci skip]
...
Diffstat (limited to 'actionpack/lib/action_dispatch/http')
-rw-r--r-- | actionpack/lib/action_dispatch/http/response.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index 2c6bcf7b7b..f14ca1ea44 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -63,6 +63,8 @@ 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 @@ -303,8 +305,17 @@ module ActionDispatch # :nodoc: !@sending_file && @charset != false end + def remove_content_type! + headers.delete CONTENT_TYPE + end + def rack_response(status, header) - assign_default_content_type_and_charset!(header) + if no_content_type + remove_content_type! + else + assign_default_content_type_and_charset!(header) + end + handle_conditional_get! header[SET_COOKIE] = header[SET_COOKIE].join("\n") if header[SET_COOKIE].respond_to?(:join) |