[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-2325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17827888#comment-17827888
 ] 

Vladimir Sitnikov edited comment on HTTPCLIENT-2325 at 3/18/24 9:08 AM:
------------------------------------------------------------------------

Oleg, as they say in https://github.com/akka/akka-http/issues/338, IIS 8.5 does 
not understand what multipart with charset means.

>Please note there will be no changes to 4.5.x beyond critical fixes.

We can't immediately bump HTC in Apache JMeter from 4.5.x to 5.x for backward 
compatibility reasons, so it would be nice if there was 4.x release though.


was (Author: vladimirsitnikov):
Oleg, as they say in https://github.com/akka/akka-http/issues/338, IIS 8.5 does 
not understand what multipart with charset means.

>Please note there will be no changes to 4.5.x beyond critical fixes.

We can't immediately bump HTC in JMeter from 4.5.x to 5.x for backward 
compatibility reasons, so it would be nice if there was 4.x release though.

> Avoid adding "; charset=" for multipart/form-data requests
> ----------------------------------------------------------
>
>                 Key: HTTPCLIENT-2325
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2325
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient (classic)
>    Affects Versions: 4.5.14
>            Reporter: Vladimir Sitnikov
>            Priority: Major
>
> Currently, HttpClient adds {{; charset=}} to {{multipart/form-data}} which 
> both
> 1) Breaks certain HTTP servers: see 
> https://github.com/apache/jmeter/pull/6251, 
> https://github.com/akka/akka-http/issues/338
> 2) Does not follow RFC 2046 and RFC 7578
> Even though including "charset" parameter is not explicitly forbidden by 
> RFCs, there are known HTTP servers that can't parse such requests, so why 
> generating the "charset=..." for multipart/form-data in the first place?
> See how RFC 7578 suggests setting the default charset: 
> https://datatracker.ietf.org/doc/html/rfc7578#section-5.1.2
> They mention a {{_charset_}} field instead.
> ----
> Unfortunately, removal of {{multipartEntityBuilder.setCharset(charset);}} in 
> the caller's code is not enough as HttpClient uses the supplied charset in 
> {{HttpBrowserCompatibleMultipart}}.
> ---
> I suggest to avoid sending {{charset}} within {{multipart/form-data}} header, 
> so it includes only {{boundary}} just like RFC 7578 samples.
> In other words, I suggest removing these lines: 
> https://github.com/apache/httpcomponents-client/blob/54900db4653d7f207477e6ee40135b88e9bcf832/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntityBuilder.java#L215-L217



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to