[
https://issues.apache.org/jira/browse/HTTPCLIENT-1112?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kevin Tobin updated HTTPCLIENT-1112:
------------------------------------
Description:
We have an application that cannot read the mime multipart generated by
HttpClient's HttpMime library but can read mime created by any other browser.
Turns out that the only difference between the HttpClient mime multipart data
is a missing linefeed at the very end of the content body.
The end of the mime multipart should be a --\r\n, However, HttpClient outputs
the carriage return character " hex 0D" but not the last line feed "hex 0A".
We are using an IBM JSF library that could not parse the mime multipart but
even worse - did not even report an error - so we spent a couple of days
tracking down the problem.
In the org.apache.http.entity.mime.HttpMultipart.java code - we can see that
the class definitely writes out the last dash dash CR and LF i.e. "--\r\n"
into its internal buffers... however the generated final output stream
delivered across the network is one byte short - i.e. missing the linefeed.
It's as if the internal Content-Length should be one byte longer.
Our Apache File Upload code works fine with the missing linefeed generated mime
data however the IBM JSF code does not.
was:
We have an application that cannot read the mime multipart generated by
HttpClient's HttpMime library but
can read mime created by any other browser.
Turns out that the only difference between the HttpClient mime multipart data
is a missing linefeed at the very end of the
the content body.
The HTTPMime Java code definitely writes out the last dash dash CR and LF i.e.
"--\r\n" into its internal buffers... but the generated final output stream is
one byte short.
>From a useability perspective this does not affect HTTP Client as it is able
>to read mime multipart missing the linefeed... but it does affect other non
>http lcienconsumers of the generated data,
> HttpClient JSF issue - missing line feed character causes JSF file upload
> parse to fail.
> ----------------------------------------------------------------------------------------
>
> Key: HTTPCLIENT-1112
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1112
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpMime
> Affects Versions: 4.1.1
> Environment: Any environment.
> Reporter: Kevin Tobin
> Labels: newbie
> Fix For: 4.1.2
>
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> We have an application that cannot read the mime multipart generated by
> HttpClient's HttpMime library but can read mime created by any other browser.
> Turns out that the only difference between the HttpClient mime multipart data
> is a missing linefeed at the very end of the content body.
> The end of the mime multipart should be a --\r\n, However, HttpClient
> outputs the carriage return character " hex 0D" but not the last line feed
> "hex 0A".
> We are using an IBM JSF library that could not parse the mime multipart but
> even worse - did not even report an error - so we spent a couple of days
> tracking down the problem.
> In the org.apache.http.entity.mime.HttpMultipart.java code - we can see that
> the class definitely writes out the last dash dash CR and LF i.e. "--\r\n"
> into its internal buffers... however the generated final output stream
> delivered across the network is one byte short - i.e. missing the linefeed.
> It's as if the internal Content-Length should be one byte longer.
> Our Apache File Upload code works fine with the missing linefeed generated
> mime data however the IBM JSF code does not.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]