tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1479248 - /tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
Date Sun, 05 May 2013 07:45:30 GMT
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


Mime
View raw message