You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2013/05/04 23:49:18 UTC
svn commit: r1479189 - in /tomcat/tc7.0.x/trunk: ./
java/org/apache/coyote/http11/AbstractHttp11Processor.java
webapps/docs/changelog.xml
Author: markt
Date: Sat May 4 21:49:16 2013
New Revision: 1479189
URL: http://svn.apache.org/r1479189
Log:
204 responses are permitted entity headers
Modified:
tomcat/tc7.0.x/trunk/ (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
Merged /tomcat/trunk:r1479179
Modified: tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1479189&r1=1479188&r2=1479189&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Sat May 4 21:49:16 2013
@@ -1378,7 +1378,8 @@ public abstract class AbstractHttp11Proc
}
MimeHeaders headers = response.getMimeHeaders();
- if (!entityBody) {
+ // A SC_NO_CONTENT (204) response may include entity headers
+ if (!entityBody && statusCode != 204) {
response.setContentLength(-1);
} else {
String contentType = response.getContentType();
Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1479189&r1=1479188&r2=1479189&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sat May 4 21:49:16 2013
@@ -90,6 +90,10 @@
exception does not cause remaining checks to be skipped. Based on a
patch by NateC.
</fix>
+ <fix>
+ Allow 204 responses (no content) to include entity headers as required
+ by RFC2616. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: svn commit: r1479189 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/coyote/http11/AbstractHttp11Processor.java
webapps/docs/changelog.xml
Posted by Mark Thomas <ma...@apache.org>.
On 05/05/2013 02:02, Konstantin Kolinko wrote:
> 2013/5/5 <ma...@apache.org>:
>> Author: markt
>> Date: Sat May 4 21:49:16 2013
>> New Revision: 1479189
>>
>> URL: http://svn.apache.org/r1479189
>> Log:
>> 204 responses are permitted entity headers
>>
>> Modified:
>> tomcat/tc7.0.x/trunk/ (props changed)
>> tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
>> tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
>>
>> Propchange: tomcat/tc7.0.x/trunk/
>> ------------------------------------------------------------------------------
>> Merged /tomcat/trunk:r1479179
>>
>> Modified: tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
>> URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1479189&r1=1479188&r2=1479189&view=diff
>> ==============================================================================
>> --- tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original)
>> +++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Sat May 4 21:49:16 2013
>> @@ -1378,7 +1378,8 @@ public abstract class AbstractHttp11Proc
>> }
>>
>> MimeHeaders headers = response.getMimeHeaders();
>> - if (!entityBody) {
>> + // A SC_NO_CONTENT (204) response may include entity headers
>> + if (!entityBody && statusCode != 204) {
>> response.setContentLength(-1);
>> } else {
>> String contentType = response.getContentType();
>>
>
> The talk in "Status 204" thread on users@ [1] was about Content-Type header,
> but this change affects Content-Length one as well.
>
> Why are you skipping "setContentLength(-1)" call?
Because I was paying attention when I made the change. I'll fix that now.
Mark
>
> [1] http://tomcat.markmail.org/thread/pah7hg7xv2wqvqs3
>
>
>> Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
>> URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1479189&r1=1479188&r2=1479189&view=diff
>> ==============================================================================
>> --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
>> +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sat May 4 21:49:16 2013
>> @@ -90,6 +90,10 @@
>> exception does not cause remaining checks to be skipped. Based on a
>> patch by NateC.
>> </fix>
>> + <fix>
>> + Allow 204 responses (no content) to include entity headers as required
>> + by RFC2616. (markt)
>> + </fix>
>> </changelog>
>> </subsection>
>
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: svn commit: r1479189 - in /tomcat/tc7.0.x/trunk: ./
java/org/apache/coyote/http11/AbstractHttp11Processor.java webapps/docs/changelog.xml
Posted by Konstantin Kolinko <kn...@gmail.com>.
2013/5/5 <ma...@apache.org>:
> Author: markt
> Date: Sat May 4 21:49:16 2013
> New Revision: 1479189
>
> URL: http://svn.apache.org/r1479189
> Log:
> 204 responses are permitted entity headers
>
> Modified:
> tomcat/tc7.0.x/trunk/ (props changed)
> tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
> tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
>
> Propchange: tomcat/tc7.0.x/trunk/
> ------------------------------------------------------------------------------
> Merged /tomcat/trunk:r1479179
>
> Modified: tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
> URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1479189&r1=1479188&r2=1479189&view=diff
> ==============================================================================
> --- tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original)
> +++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Sat May 4 21:49:16 2013
> @@ -1378,7 +1378,8 @@ public abstract class AbstractHttp11Proc
> }
>
> MimeHeaders headers = response.getMimeHeaders();
> - if (!entityBody) {
> + // A SC_NO_CONTENT (204) response may include entity headers
> + if (!entityBody && statusCode != 204) {
> response.setContentLength(-1);
> } else {
> String contentType = response.getContentType();
>
The talk in "Status 204" thread on users@ [1] was about Content-Type header,
but this change affects Content-Length one as well.
Why are you skipping "setContentLength(-1)" call?
[1] http://tomcat.markmail.org/thread/pah7hg7xv2wqvqs3
> Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
> URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1479189&r1=1479188&r2=1479189&view=diff
> ==============================================================================
> --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
> +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sat May 4 21:49:16 2013
> @@ -90,6 +90,10 @@
> exception does not cause remaining checks to be skipped. Based on a
> patch by NateC.
> </fix>
> + <fix>
> + Allow 204 responses (no content) to include entity headers as required
> + by RFC2616. (markt)
> + </fix>
> </changelog>
> </subsection>
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org