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/05 09:45:30 UTC

svn commit: r1479248 - /tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java

Author: markt
Date: Sun May  5 07:45:29 2013
New Revision: 1479248

URL: http://svn.apache.org/r1479248
Log:
Deal properly with 204 responses

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1479248&r1=1479247&r2=1479248&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Sun May  5 07:45:29 2013
@@ -1363,10 +1363,11 @@ public abstract class AbstractHttp11Proc
         }
 
         MimeHeaders headers = response.getMimeHeaders();
-        // A SC_NO_CONTENT response may include entity headers
-        if (!entityBody && statusCode != HttpServletResponse.SC_NO_CONTENT) {
+        if (!entityBody) {
             response.setContentLength(-1);
-        } else {
+        }
+        // A SC_NO_CONTENT response may include entity headers
+        if (entityBody || statusCode == HttpServletResponse.SC_NO_CONTENT) {
             String contentType = response.getContentType();
             if (contentType != null) {
                 headers.setValue("Content-Type").setString(contentType);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org