You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (JIRA)" <ji...@apache.org> on 2014/06/06 12:05:01 UTC

[jira] [Updated] (HTTPCORE-382) org.apache.http.entity.ContentType#get method is too strict regarding malformed Content-Type headers

     [ 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org