Permalink
Browse files

Merge branch 'rfc7231-sec6.3.6-205'

* rfc7231-sec6.3.6-205:
  Revert "Add 205 Reset Content to the list of statuses without a message body"
  • Loading branch information...
2 parents 85065cf + bcf2698 commit 0d74df67db33cc2a9858ea1568bf47ad8583d84c @tenderlove tenderlove committed Feb 15, 2017
Showing with 12 additions and 12 deletions.
  1. +2 −2 SPEC
  2. +2 −2 lib/rack/lint.rb
  3. +1 −1 lib/rack/mock.rb
  4. +1 −1 lib/rack/response.rb
  5. +1 −1 lib/rack/utils.rb
  6. +1 −1 test/spec_chunked.rb
  7. +2 −2 test/spec_lint.rb
  8. +2 −2 test/spec_response.rb
View
@@ -237,10 +237,10 @@ consisting of lines (for multiple header values, e.g. multiple
The lines must not contain characters below 037.
=== The Content-Type
There must not be a <tt>Content-Type</tt>, when the +Status+ is 1xx,
-204, 205 or 304.
+204 or 304.
=== The 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.
=== The Body
The Body must respond to +each+
and must only yield String values.
View
@@ -659,7 +659,7 @@ def check_headers(header)
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 @@ def check_content_length(status, headers)
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
}
View
@@ -190,7 +190,7 @@ def body
end
def empty?
- [201, 204, 205, 304].include? status
+ [201, 204, 304].include? status
end
end
end
@@ -60,7 +60,7 @@ def chunked?
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
View
@@ -576,7 +576,7 @@ def names
}
# 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]
@@ -92,7 +92,7 @@ def chunked(app)
body.join.must_equal 'Hello World!'
end
- [100, 204, 205, 304].each do |status_code|
+ [100, 204, 304].each do |status_code|
it "not modify response when status code is #{status_code}" do
app = lambda { |env| [status_code, {}, []] }
status, headers, _ = chunked(app).call(@env)
View
@@ -269,7 +269,7 @@ def result.name
# }.must_raise(Rack::Lint::LintError).
# message.must_match(/No Content-Type/)
- [100, 101, 204, 205, 304].each do |status|
+ [100, 101, 204, 304].each do |status|
lambda {
Rack::Lint.new(lambda { |env|
[status, {"Content-type" => "text/plain", "Content-length" => "0"}, []]
@@ -280,7 +280,7 @@ def result.name
end
it "notice content-length errors" do
- [100, 101, 204, 205, 304].each do |status|
+ [100, 101, 204, 304].each do |status|
lambda {
Rack::Lint.new(lambda { |env|
[status, {"Content-length" => "0"}, []]
@@ -410,7 +410,7 @@ def object_with_each.each
res.body.must_be :closed?
end
- it "calls close on #body when 204, 205, or 304" do
+ it "calls close on #body when 204 or 304" do
res = Rack::Response.new
res.body = StringIO.new
res.finish
@@ -424,7 +424,7 @@ def object_with_each.each
res.body = StringIO.new
res.status = 205
_, _, b = res.finish
- res.body.must_be :closed?
+ res.body.wont_be :closed?
b.wont_equal res.body
res.body = StringIO.new

0 comments on commit 0d74df6

Please sign in to comment.