hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r165655 - /jakarta/httpclient/trunk/http-common/src/java/org/apache/http/interceptor/RequestContentInterceptor.java /jakarta/httpclient/trunk/http-common/src/java/org/apache/http/interceptor/ResponseContentInterceptor.java
Date Mon, 02 May 2005 18:02:27 GMT
Author: olegk
Date: Mon May  2 11:02:26 2005
New Revision: 165655

URL: http://svn.apache.org/viewcvs?rev=165655&view=rev
Log:
Defensively remove Transfer-Encoding/Content-Length which may be invalid in the given context

Modified:
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/interceptor/RequestContentInterceptor.java
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/interceptor/ResponseContentInterceptor.java

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/interceptor/RequestContentInterceptor.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/interceptor/RequestContentInterceptor.java?rev=165655&r1=165654&r2=165655&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/interceptor/RequestContentInterceptor.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/interceptor/RequestContentInterceptor.java
Mon May  2 11:02:26 2005
@@ -75,9 +75,11 @@
                             "Chunked transfer encoding not allowed for " + ver);
                 }
                 request.setHeader(new Header(TRANSFER_ENC, "chunked", true));
+                request.removeHeaders(CONTENT_LEN);
             } else {
                 request.setHeader(new Header(CONTENT_LEN, 
                         Long.toString(entity.getContentLength()), true));
+                request.removeHeaders(TRANSFER_ENC);
             }
             // Specify a content type if known
             if (entity.getContentType() != null) {

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/interceptor/ResponseContentInterceptor.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/interceptor/ResponseContentInterceptor.java?rev=165655&r1=165654&r2=165655&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/interceptor/ResponseContentInterceptor.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/interceptor/ResponseContentInterceptor.java
Mon May  2 11:02:26 2005
@@ -73,9 +73,11 @@
                         "Chunked transfer encoding not allowed for " + ver);
             }
             response.setHeader(new Header(TRANSFER_ENC, "chunked", true));
+            response.removeHeaders(CONTENT_LEN);
         } else {
             response.setHeader(new Header(CONTENT_LEN, 
                     Long.toString(entity.getContentLength()), true));
+            response.removeHeaders(TRANSFER_ENC);
         }
         // Specify a content type if known
         if (entity.getContentType() != null) {



Mime
View raw message