From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Status: No, score=-3.5 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from mail-yb0-f186.google.com (mail-yb0-f186.google.com [209.85.213.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 5A0D81FF6D for ; Thu, 15 Dec 2016 19:46:06 +0000 (UTC) Received: by mail-yb0-f186.google.com with SMTP id d128sf19231060ybh.1 for ; Thu, 15 Dec 2016 11:46:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:in-reply-to:references:from:date:message-id :subject:to:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:x-spam-checked-in-group :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=ey9JgjXNVc/UKZh7cTMBP5ZQ3P43ao7/SeaYiPd3c7Y=; b=VURwm3GeS5Z4HKDZ6OToJru61OTDrPCvvc0pVnHhbdXyIQVArAzAEYIbsiWpQiYT9h Gxk7QJCAjo14NjV9db7PNl6ataeU7AG3Dz2VlRhkMSbSfvIKuVuIyY0psPPprp+Gl8ob qR2yFRh4HH/jZFpw1YENg9344R1K4pMddplWubJ2bEJs2Q9SckncenRNb1+gIUjW0G18 eZK7mKE/ZHpJm1WQCkdX/ZTlRVKSZ1ZpP6Druhq9ID237RwyA8YmsQLk4p9ZzFHUzK5E Edh6jn8Me7sdRMLC3rAmed3ChBAcmJLrIzPm0HaLXYAhvO3lnlCe90Oqdb8PMRKr1WPl 3BmQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=ey9JgjXNVc/UKZh7cTMBP5ZQ3P43ao7/SeaYiPd3c7Y=; b=KxWh72jrHsGccMLCtTAIFQ24eCHaYSFFvGYPRGdTYcamQrL3BvmpBH/eSROBL8LmRx f5u6mrY2mwASREnzAiefyy0w+5tQ1gvpfgZRDRLBqzNomOC2TIea4WJV91M7+2dWSvX9 Nl9RtnA1XTQmD+nQbnxsjw3gs6fMuujWH9AERgtTxlNiGMAYpHcQtUd0pDKBg/XiDu/+ mUlPDKW/cPMbDbykDjcWbEnZ2YGkxKa8+11fNoBkjNRdnllt2IJ26mhK24Kb2NNedhsO oXWFMX4DpAhEzLxp70eTAfDBC4WcPBfKhugXxj0AcCuD615tKhBOOp+TNnPubXjk9/Qc uLjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:in-reply-to:references:from :date:message-id:subject:to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=ey9JgjXNVc/UKZh7cTMBP5ZQ3P43ao7/SeaYiPd3c7Y=; b=F1MRfM/bpIZdGy7TvlLEjffijfudlUSgS0fhHy6ZgdLfvRXuVJvekzmwTqeHeDB2rh uW6RCApKYGSAR3mcuyxPTpcUkIQGILYF6G1qhcKzBsqYhtq97dq3EZIymostNeX+x+m/ pekhtt/5l6ilZczM1JsQNGqRLRONGdd5oyVEo+j83qXp3jUYS6mF3Sg985jTUhk9wM/x ii5QwNjNHtSZLDnmTTvwmV0kM2eauTs5eR9oODMjDkryRH+SipdaVAR2v4SzmlC+9drT O3Jj/S5y12YsmcFvy765FPlrivVor/Fkej6NKkLcdX1j8aTyczFqoB8b9Dxs5xHCD/Bx EM6g== Sender: rack-devel@googlegroups.com X-Gm-Message-State: AKaTC000ynG0dlhl/x72dLAyWK5Mm/CbIeSUm7xmby10P5KJviFA6hNlv62gwZBwjlWQqQ== X-Received: by 10.36.20.12 with SMTP id 12mr1080itg.9.1481831165400; Thu, 15 Dec 2016 11:46:05 -0800 (PST) X-BeenThere: rack-devel@googlegroups.com Received: by 10.107.170.221 with SMTP id g90ls1931868ioj.23.gmail; Thu, 15 Dec 2016 11:46:04 -0800 (PST) X-Received: by 10.98.96.195 with SMTP id u186mr663134pfb.37.1481831164891; Thu, 15 Dec 2016 11:46:04 -0800 (PST) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com. [2607:f8b0:4001:c06::244]) by gmr-mx.google.com with ESMTPS id p84si1442itg.1.2016.12.15.11.46.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Dec 2016 11:46:04 -0800 (PST) Received-SPF: pass (google.com: domain of jftucker@gmail.com designates 2607:f8b0:4001:c06::244 as permitted sender) client-ip=2607:f8b0:4001:c06::244; Received: by mail-io0-x244.google.com with SMTP id f73so9551193ioe.2 for ; Thu, 15 Dec 2016 11:46:04 -0800 (PST) X-Received: by 10.107.34.74 with SMTP id i71mr3539636ioi.24.1481831164477; Thu, 15 Dec 2016 11:46:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.30.14 with HTTP; Thu, 15 Dec 2016 11:46:03 -0800 (PST) In-Reply-To: <20161214221449.GA24731@dcvr> References: <20161214221449.GA24731@dcvr> From: James Tucker Date: Thu, 15 Dec 2016 11:46:03 -0800 Message-ID: Subject: Re: [PATCH] Revert "Add 205 Reset Content to the list of statuses without a message body" To: Rack Development Content-Type: multipart/alternative; boundary=001a1140f2542d089c0543b7b4c1 X-Original-Sender: jftucker@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com; spf=pass (google.com: domain of jftucker@gmail.com designates 2607:f8b0:4001:c06::244 as permitted sender) smtp.mailfrom=jftucker@gmail.com; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: X-Google-Group-Id: 486215384060 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , --001a1140f2542d089c0543b7b4c1 Content-Type: text/plain; charset=UTF-8 +1 On Wed, Dec 14, 2016 at 2:14 PM, Eric Wong wrote: > RFC 7231, section 6.3.5 gives three possible options for what a > server MUST do when sending a 205 status code: > > > Since the 205 status code implies that no additional content will be > > provided, a server MUST NOT generate a payload in a 205 response. In > > other words, a server MUST do one of the following for a 205 > > response: a) indicate a zero-length body for the response by > > including a Content-Length header field with a value of 0; b) > > indicate a zero-length payload for the response by including a > > Transfer-Encoding header field with a value of chunked and a message > > body consisting of a single chunk of zero-length; or, c) close the > > connection immediately after sending the blank line terminating the > > header section. > > rack itself has no control over c), but should leave options > a) and b) available for middleware and application authors. > > https://tools.ietf.org/html/rfc7231#section-6.3.6 > > The older RFC 2616 text was vague and not specific about > what a server should do: > > https://tools.ietf.org/html/rfc2616#section-10.2.6 > > I noticed this from Plack: https://metacpan.org/pod/Plack::Util > > This reverts commit 2c5b076aaba6c83ffce8c6c2b5c49085c1abb5a5. > --- > If you prefer to use "git pull" or "git merge": > > The following changes since commit 9e73bd1ae7b5df937302a148ab99bf > 3be12eb063: > > Merge pull request #1135 from tonytonyjan/patch-rdoc (2016-12-08 > 13:13:44 -0500) > > are available in the git repository at: > > git://80x24.org/rack rfc7231-sec6.3.6-205 > > for you to fetch changes up to bcf2698bcc90f346b145538e53d0d61bcceb2e48: > > Revert "Add 205 Reset Content to the list of statuses without a > message body" (2016-12-14 21:58:54 +0000) > > ---------------------------------------------------------------- > Eric Wong (1): > Revert "Add 205 Reset Content to the list of statuses without a > message body" > > SPEC | 4 ++-- > lib/rack/lint.rb | 4 ++-- > lib/rack/mock.rb | 2 +- > lib/rack/response.rb | 2 +- > lib/rack/utils.rb | 2 +- > test/spec_chunked.rb | 2 +- > test/spec_lint.rb | 4 ++-- > test/spec_response.rb | 4 ++-- > 8 files changed, 12 insertions(+), 12 deletions(-) > > diff --git a/SPEC b/SPEC > index 7e3af40a..9b278846 100644 > --- a/SPEC > +++ b/SPEC > @@ -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 Content-Type, when the +Status+ is 1xx, > -204, 205 or 304. > +204 or 304. > === The Content-Length > There must not be a Content-Length 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. > 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 Content-Type, 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 Content-Length 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] > diff --git a/test/spec_chunked.rb b/test/spec_chunked.rb > index 7bbcfd92..dc6e8c9d 100644 > --- a/test/spec_chunked.rb > +++ b/test/spec_chunked.rb > @@ -92,7 +92,7 @@ describe Rack::Chunked do > 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) > diff --git a/test/spec_lint.rb b/test/spec_lint.rb > index 6d1c2c45..d99c1aa3 100644 > --- a/test/spec_lint.rb > +++ b/test/spec_lint.rb > @@ -269,7 +269,7 @@ describe Rack::Lint do > # }.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 @@ describe Rack::Lint do > 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"}, []] > diff --git a/test/spec_response.rb b/test/spec_response.rb > index 2dd2c001..987199de 100644 > --- a/test/spec_response.rb > +++ b/test/spec_response.rb > @@ -410,7 +410,7 @@ describe Rack::Response do > 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 @@ describe Rack::Response do > 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 > -- > EW > > -- > > --- > You received this message because you are subscribed to the Google Groups > "Rack Development" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rack-devel+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- --- You received this message because you are subscribed to the Google Groups "Rack Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to rack-devel+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout. --001a1140f2542d089c0543b7b4c1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
+1

On Wed, Dec 14, 2016 at 2:14 PM, Eric Wong <e@80x24.org> w= rote:
RFC 7231, section 6.3.5 gives three= possible options for what a
server MUST do when sending a 205 status code:

> Since the 205 status code implies that no additional content will be > provided, a server MUST NOT generate a payload in a 205 response.=C2= =A0 In
> other words, a server MUST do one of the following for a 205
> response: a) indicate a zero-length body for the response by
> including a Content-Length header field with a value of 0; b)
> indicate a zero-length payload for the response by including a
> Transfer-Encoding header field with a value of chunked and a message > body consisting of a single chunk of zero-length; or, c) close the
> connection immediately after sending the blank line terminating the > header section.

rack itself has no control over c), but should leave options
a) and b) available for middleware and application authors.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 https://tools.ietf.org/= html/rfc7231#section-6.3.6

The older RFC 2616 text was vague and not specific about
what a server should do:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 https://tools.ietf.org= /html/rfc2616#section-10.2.6

I noticed this from Plack: https://metacpan.org/pod/Plack::= Util

This reverts commit 2c5b076aaba6c83ffce8c6c2b5c49085c1abb5a5.
---
=C2=A0 If you prefer to use "git pull" or "git merge":<= br>
=C2=A0 The following changes since commit 9e73bd1ae7b5df937302a148ab99bf3be12eb063:

=C2=A0 =C2=A0 Merge pull request #1135 from tonytonyjan/patch-rdoc (2016-12= -08 13:13:44 -0500)

=C2=A0 are available in the git repository at:

=C2=A0 =C2=A0 git://80x24.org/rack rfc7231-sec6.3.6-205

=C2=A0 for you to fetch changes up to bcf2698bcc90f346b145538e53d0d61b= cceb2e48:

=C2=A0 =C2=A0 Revert "Add 205 Reset Content to the list of statuses wi= thout a message body" (2016-12-14 21:58:54 +0000)

=C2=A0 ----------------------------------------------------------------
=C2=A0 Eric Wong (1):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Revert "Add 205 Reset Content to the list = of statuses without a message body"

=C2=A0SPEC=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | = 4 ++--
=C2=A0lib/rack/lint.rb=C2=A0 =C2=A0 =C2=A0 | 4 ++--
=C2=A0lib/rack/mock.rb=C2=A0 =C2=A0 =C2=A0 | 2 +-
=C2=A0lib/rack/response.rb=C2=A0 | 2 +-
=C2=A0lib/rack/utils.rb=C2=A0 =C2=A0 =C2=A0| 2 +-
=C2=A0test/spec_chunked.rb=C2=A0 | 2 +-
=C2=A0test/spec_lint.rb=C2=A0 =C2=A0 =C2=A0| 4 ++--
=C2=A0test/spec_response.rb | 4 ++--
=C2=A08 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/SPEC b/SPEC
index 7e3af40a..9b278846 100644
--- a/SPEC
+++ b/SPEC
@@ -237,10 +237,10 @@ consisting of lines (for multiple header values, e.g.= multiple
=C2=A0The lines must not contain characters below 037.
=C2=A0=3D=3D=3D The Content-Type
=C2=A0There must not be a <tt>Content-Type</tt>, when the +Stat= us+ is 1xx,
-204, 205 or 304.
+204 or 304.
=C2=A0=3D=3D=3D The Content-Length
=C2=A0There must not be a <tt>Content-Length</tt> header when t= he
-+Status+ is 1xx, 204, 205 or 304.
++Status+ is 1xx, 204 or 304.
=C2=A0=3D=3D=3D The Body
=C2=A0The Body must respond to +each+
=C2=A0and must only yield String values.
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
=C2=A0 =C2=A0 =C2=A0def check_content_type(status, headers)
=C2=A0 =C2=A0 =C2=A0 =C2=A0headers.each { |key, value|
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0## There must not be a <tt>Content-= Type</tt>, when the +Status+ is 1xx,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 ## 204, 205 or 304.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 ## 204 or 304.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if key.downcase =3D=3D "content-type= "
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0assert("Content-Type header f= ound in #{status} response, not allowed") {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0not Rack::Utils::STATUS_WIT= H_NO_ENTITY_BODY.include? status.to_i
@@ -674,7 +674,7 @@ module Rack
=C2=A0 =C2=A0 =C2=A0 =C2=A0headers.each { |key, value|
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if key.downcase =3D=3D 'content-lengt= h'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0## There must not be a <tt>C= ontent-Length</tt> header when the
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ## +Status+ is 1xx, 204, 205 or 304. +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ## +Status+ is 1xx, 204 or 304.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0assert("Content-Length header= found in #{status} response, not allowed") {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0not Rack::Utils::STATUS_WIT= H_NO_ENTITY_BODY.include? status.to_i
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
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
=C2=A0 =C2=A0 =C2=A0end

=C2=A0 =C2=A0 =C2=A0def empty?
-=C2=A0 =C2=A0 =C2=A0 [201, 204, 205, 304].include? status
+=C2=A0 =C2=A0 =C2=A0 [201, 204, 304].include? status
=C2=A0 =C2=A0 =C2=A0end
=C2=A0 =C2=A0end
=C2=A0end
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
=C2=A0 =C2=A0 =C2=A0def finish(&block)
=C2=A0 =C2=A0 =C2=A0 =C2=A0@block =3D block

-=C2=A0 =C2=A0 =C2=A0 if [204, 205, 304].include?(status.to_i)
+=C2=A0 =C2=A0 =C2=A0 if [204, 304].include?(status.to_i)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0delete_header CONTENT_TYPE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0delete_header CONTENT_LENGTH
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0close
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
=C2=A0 =C2=A0 =C2=A0}

=C2=A0 =C2=A0 =C2=A0# Responses with HTTP status codes that should not have= an entity body
-=C2=A0 =C2=A0 STATUS_WITH_NO_ENTITY_BODY =3D Set.new((100..199).to_a <&= lt; 204 << 205 << 304)
+=C2=A0 =C2=A0 STATUS_WITH_NO_ENTITY_BODY =3D Set.new((100..199).to_a <&= lt; 204 << 304)

=C2=A0 =C2=A0 =C2=A0SYMBOL_TO_STATUS_CODE =3D Hash[*HTTP_STATUS_CODES.map {= |code, message|
=C2=A0 =C2=A0 =C2=A0 =C2=A0[message.downcase.gsub(/\s|-|'/, '_= ').to_sym, code]
diff --git a/test/spec_chunked.rb b/test/spec_chunked.rb
index 7bbcfd92..dc6e8c9d 100644
--- a/test/spec_chunked.rb
+++ b/test/spec_chunked.rb
@@ -92,7 +92,7 @@ describe Rack::Chunked do
=C2=A0 =C2=A0 =C2=A0body.join.must_equal 'Hello World!'
=C2=A0 =C2=A0end

-=C2=A0 [100, 204, 205, 304].each do |status_code|
+=C2=A0 [100, 204, 304].each do |status_code|
=C2=A0 =C2=A0 =C2=A0it "not modify response when status code is #{stat= us_code}" do
=C2=A0 =C2=A0 =C2=A0 =C2=A0app =3D lambda { |env| [status_code, {}, []] } =C2=A0 =C2=A0 =C2=A0 =C2=A0status, headers, _ =3D chunked(app).call(@env) diff --git a/test/spec_lint.rb b/test/spec_lint.rb
index 6d1c2c45..d99c1aa3 100644
--- a/test/spec_lint.rb
+++ b/test/spec_lint.rb
@@ -269,7 +269,7 @@ describe Rack::Lint do
=C2=A0 =C2=A0 =C2=A0# }.must_raise(Rack::Lint::LintError).
=C2=A0 =C2=A0 =C2=A0#=C2=A0 =C2=A0message.must_match(/No Content-Type/)

-=C2=A0 =C2=A0 [100, 101, 204, 205, 304].each do |status|
+=C2=A0 =C2=A0 [100, 101, 204, 304].each do |status|
=C2=A0 =C2=A0 =C2=A0 =C2=A0lambda {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Rack::Lint.new(lambda { |env|
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 [status, {"Content-type" =3D> "text/pla= in", "Content-length" =3D> "0"}, []]
@@ -280,7 +280,7 @@ describe Rack::Lint do
=C2=A0 =C2=A0end

=C2=A0 =C2=A0it "notice content-length errors" do
-=C2=A0 =C2=A0 [100, 101, 204, 205, 304].each do |status|
+=C2=A0 =C2=A0 [100, 101, 204, 304].each do |status|
=C2=A0 =C2=A0 =C2=A0 =C2=A0lambda {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Rack::Lint.new(lambda { |env|
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 [status, {"Content-length" =3D> "0"= ;}, []]
diff --git a/test/spec_response.rb b/test/spec_response.rb
index 2dd2c001..987199de 100644
--- a/test/spec_response.rb
+++ b/test/spec_response.rb
@@ -410,7 +410,7 @@ describe Rack::Response do
=C2=A0 =C2=A0 =C2=A0res.body.must_be :closed?
=C2=A0 =C2=A0end

-=C2=A0 it "calls close on #body when 204, 205, or 304" do
+=C2=A0 it "calls close on #body when 204 or 304" do
=C2=A0 =C2=A0 =C2=A0res =3D Rack::Response.new
=C2=A0 =C2=A0 =C2=A0res.body =3D StringIO.new
=C2=A0 =C2=A0 =C2=A0res.finish
@@ -424,7 +424,7 @@ describe Rack::Response do
=C2=A0 =C2=A0 =C2=A0res.body =3D StringIO.new
=C2=A0 =C2=A0 =C2=A0res.status =3D 205
=C2=A0 =C2=A0 =C2=A0_, _, b =3D res.finish
-=C2=A0 =C2=A0 res.body.must_be :closed?
+=C2=A0 =C2=A0 res.body.wont_be :closed?
=C2=A0 =C2=A0 =C2=A0b.wont_equal res.body

=C2=A0 =C2=A0 =C2=A0res.body =3D StringIO.new
--
EW

--

---
You received this message because you are subscribed to the Google Groups &= quot;Rack Development" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to rack-d= evel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups &= quot;Rack Development" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to
rack-dev= el+unsubscribe@googlegroups.com.
For more options, visit http= s://groups.google.com/d/optout.
--001a1140f2542d089c0543b7b4c1--