hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1654999 - in /httpcomponents/httpclient/branches/4.3.x/httpclient/src: main/java/org/apache/http/client/entity/EntityBuilder.java test/java/org/apache/http/client/entity/TestEntityBuilder.java
Date Tue, 27 Jan 2015 10:31:53 GMT
Author: olegk
Date: Tue Jan 27 10:31:52 2015
New Revision: 1654999

URL: http://svn.apache.org/r1654999
Log:
HTTPCLIENT-1605: EntityBuilder sets incorrect content length for entities backed by InputStream

Modified:
    httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/client/entity/EntityBuilder.java
    httpcomponents/httpclient/branches/4.3.x/httpclient/src/test/java/org/apache/http/client/entity/TestEntityBuilder.java

Modified: httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/client/entity/EntityBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/client/entity/EntityBuilder.java?rev=1654999&r1=1654998&r2=1654999&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/client/entity/EntityBuilder.java
(original)
+++ httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/client/entity/EntityBuilder.java
Tue Jan 27 10:31:52 2015
@@ -316,7 +316,7 @@ public class EntityBuilder {
         } else if (this.binary != null) {
             e = new ByteArrayEntity(this.binary, getContentOrDefault(ContentType.DEFAULT_BINARY));
         } else if (this.stream != null) {
-            e = new InputStreamEntity(this.stream, 1, getContentOrDefault(ContentType.DEFAULT_BINARY));
+            e = new InputStreamEntity(this.stream, -1, getContentOrDefault(ContentType.DEFAULT_BINARY));
         } else if (this.parameters != null) {
             e = new UrlEncodedFormEntity(this.parameters,
                     this.contentType != null ? this.contentType.getCharset() : null);

Modified: httpcomponents/httpclient/branches/4.3.x/httpclient/src/test/java/org/apache/http/client/entity/TestEntityBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.3.x/httpclient/src/test/java/org/apache/http/client/entity/TestEntityBuilder.java?rev=1654999&r1=1654998&r2=1654999&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.3.x/httpclient/src/test/java/org/apache/http/client/entity/TestEntityBuilder.java
(original)
+++ httpcomponents/httpclient/branches/4.3.x/httpclient/src/test/java/org/apache/http/client/entity/TestEntityBuilder.java
Tue Jan 27 10:31:52 2015
@@ -71,6 +71,7 @@ public class TestEntityBuilder {
         Assert.assertNotNull(entity);
         Assert.assertNotNull(entity.getContent());
         Assert.assertNotNull(entity.getContentType());
+        Assert.assertEquals(-1, entity.getContentLength());
         Assert.assertEquals("application/octet-stream", entity.getContentType().getValue());
     }
 



Mime
View raw message