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

Oleg Kalnichevski updated HTTPCORE-382:
---------------------------------------

    Fix Version/s: 4.4-alpha1

HC core components are generally content agnostic and unable to differentiate 
binary MIME types from non-binary ones. We could however provide a lenient 
version of #get method or ignore unrecognized charsets altogether.

Oleg

> org.apache.http.entity.ContentType#get method is too strict regarding 
> malformed Content-Type headers
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-382
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-382
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>          Components: HttpCore
>    Affects Versions: 4.3.2
>            Reporter: Cservenak, Tamas
>            Priority: Minor
>             Fix For: 4.4-alpha1
>
>
> One HTTP server serving up ZIP/JAR file sends this header in it's response:
> {noformat}
> Content-Type: application/zip; charset=binary
> {noformat}
> While this is _malformed_ header value (according to rfc2068 "Applications 
> SHOULD limit their use of character sets to those defined by the IANA 
> registry", and IANA does not define "binary"), HttpClient should be more 
> robust IMO.
> In this case, it might accept the mime type {{application/zip}} only and just 
> neglect the charset (that results in 
> {{java.nio.charset.UnsupportedCharsetException: binary}} anyway), since 
> {{application/zip}} is not a text subtype.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to