Skip to content
Browse files

extract no content response codes to a constant

  • Loading branch information...
1 parent 95a2ccc commit 5fe68292c2ae46fed868b53fff04396e0f465019 @vipulnsward vipulnsward committed Apr 22, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 actionpack/lib/action_dispatch/http/response.rb
View
3 actionpack/lib/action_dispatch/http/response.rb
@@ -55,6 +55,7 @@ class Response
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 @@ def rack_response(status, header)
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

0 comments on commit 5fe6829

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