tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1479249 - /tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
Date Sun, 05 May 2013 07:47:28 GMT
Author: markt
Date: Sun May  5 07:47:28 2013
New Revision: 1479249

URL: http://svn.apache.org/r1479249
Log:
Deal properly with 204 responses
Fix an irritating warning

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

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=1479249&r1=1479248&r2=1479249&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 Sun May
 5 07:47:28 2013
@@ -816,7 +816,6 @@ public abstract class AbstractHttp11Proc
             InputFilter savedBody = new SavedRequestInputFilter(body);
             savedBody.setRequest(request);
 
-            @SuppressWarnings("unchecked")
             AbstractInputBuffer<S> internalBuffer = (AbstractInputBuffer<S>)
                 request.getInputBuffer();
             internalBuffer.addActiveFilter(savedBody);
@@ -1378,10 +1377,11 @@ public abstract class AbstractHttp11Proc
         }
 
         MimeHeaders headers = response.getMimeHeaders();
-        // A SC_NO_CONTENT (204) response may include entity headers
-        if (!entityBody && statusCode != 204) {
+        if (!entityBody) {
             response.setContentLength(-1);
-        } else {
+        }
+        // A SC_NO_CONTENT response may include entity headers
+        if (entityBody || statusCode == 204) {
             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