diff options
Diffstat (limited to 'lib/rack')
-rw-r--r-- | lib/rack/lint.rb | 4 | ||||
-rw-r--r-- | lib/rack/mock.rb | 2 | ||||
-rw-r--r-- | lib/rack/response.rb | 2 | ||||
-rw-r--r-- | lib/rack/utils.rb | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/lib/rack/lint.rb b/lib/rack/lint.rb index 54d37822..683ba684 100644 --- a/lib/rack/lint.rb +++ b/lib/rack/lint.rb @@ -659,7 +659,7 @@ module Rack def check_content_type(status, headers) headers.each { |key, value| ## There must not be a <tt>Content-Type</tt>, when the +Status+ is 1xx, - ## 204, 205 or 304. + ## 204 or 304. if key.downcase == "content-type" assert("Content-Type header found in #{status} response, not allowed") { not Rack::Utils::STATUS_WITH_NO_ENTITY_BODY.include? status.to_i @@ -674,7 +674,7 @@ module Rack headers.each { |key, value| if key.downcase == 'content-length' ## There must not be a <tt>Content-Length</tt> header when the - ## +Status+ is 1xx, 204, 205 or 304. + ## +Status+ is 1xx, 204 or 304. assert("Content-Length header found in #{status} response, not allowed") { not Rack::Utils::STATUS_WITH_NO_ENTITY_BODY.include? status.to_i } diff --git a/lib/rack/mock.rb b/lib/rack/mock.rb index 4ebc4df1..afc855e2 100644 --- a/lib/rack/mock.rb +++ b/lib/rack/mock.rb @@ -190,7 +190,7 @@ module Rack end def empty? - [201, 204, 205, 304].include? status + [201, 204, 304].include? status end end end diff --git a/lib/rack/response.rb b/lib/rack/response.rb index 9ac47aad..a9f0c2a3 100644 --- a/lib/rack/response.rb +++ b/lib/rack/response.rb @@ -60,7 +60,7 @@ module Rack def finish(&block) @block = block - if [204, 205, 304].include?(status.to_i) + if [204, 304].include?(status.to_i) delete_header CONTENT_TYPE delete_header CONTENT_LENGTH close diff --git a/lib/rack/utils.rb b/lib/rack/utils.rb index 7b842125..c253f3cf 100644 --- a/lib/rack/utils.rb +++ b/lib/rack/utils.rb @@ -576,7 +576,7 @@ module Rack } # Responses with HTTP status codes that should not have an entity body - STATUS_WITH_NO_ENTITY_BODY = Set.new((100..199).to_a << 204 << 205 << 304) + STATUS_WITH_NO_ENTITY_BODY = Set.new((100..199).to_a << 204 << 304) SYMBOL_TO_STATUS_CODE = Hash[*HTTP_STATUS_CODES.map { |code, message| [message.downcase.gsub(/\s|-|'/, '_').to_sym, code] |