diff options
author | Vipul A M <vipulnsward@gmail.com> | 2013-04-22 15:51:25 +0530 |
---|---|---|
committer | Vipul A M <vipulnsward@gmail.com> | 2013-04-22 15:51:25 +0530 |
commit | 5fe68292c2ae46fed868b53fff04396e0f465019 (patch) | |
tree | eeec9230e60c3a050892e9d91a9e5e8444be92aa /actionpack/lib/action_dispatch | |
parent | 95a2ccc0117c48725d296761dd025646406a6270 (diff) | |
download | rails-5fe68292c2ae46fed868b53fff04396e0f465019.tar.gz rails-5fe68292c2ae46fed868b53fff04396e0f465019.tar.bz2 rails-5fe68292c2ae46fed868b53fff04396e0f465019.zip |
extract no content response codes to a constant
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/http/response.rb | 3 |
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 |