hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (HTTPCLIENT-1605) Cannot upload files with HttpClient 4.3.6 using PUT/POST
Date Tue, 27 Jan 2015 10:41:36 GMT

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1605?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oleg Kalnichevski resolved HTTPCLIENT-1605.
-------------------------------------------
       Resolution: Fixed
    Fix Version/s: 4.4 Final

Fixed in SVN trunk and 4.3.x branch. Please review / re-test.

Oleg

> Cannot upload files with HttpClient 4.3.6 using PUT/POST
> --------------------------------------------------------
>
>                 Key: HTTPCLIENT-1605
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1605
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.3.6
>            Reporter: Svetlin Zarev
>              Labels: easyfix
>             Fix For: 4.4 Final
>
>
> Affected component: HttpClient 4.3.6
> Class: org.apache.http.client.entity.EntityBuilder
> When building a new HttpEntity using the EntityBuilder, the method EntityBuilder.setStream()
always sets the content length of the stream to 1, which causes http PUT/POST requests to
upload only 1 byte, instead of the whole content of the stream.
> Line 319:
> {code}
> if (this.stream != null) {
>             e = new InputStreamEntity(this.stream, 1, getContentOrDefault(ContentType.DEFAULT_BINARY));
>         }
> {code}
> It should be:
> {code}
> if (this.stream != null) {
>             e = new InputStreamEntity(this.stream, -1, getContentOrDefault(ContentType.DEFAULT_BINARY));
>         }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message