[
https://issues.apache.org/jira/browse/HTTPCLIENT-1643?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14508693#comment-14508693
]
Julien Nioche commented on HTTPCLIENT-1643:
-------------------------------------------
Thanks for taking the time to reply Oleg.
it's not so much about handling non-standard encoding as such but having the
library being more robust when it comes across non-standard values. As a user I
don't necessarily want to or know how to do the decoding manually : I just
expect the library not to throw an exception when it comes across something
that is not standard. If the encoding is not a standard value then the content
should be probably treated as not encoded.
Disabling the content compression as you suggested would mean that I'd need to
duplicate what the library does for handling the encoding which is cumbersome
and not very user friendly.
Maybe there could be an option to be strict on the value or not. If a non
standard value is found and the option is on strict then throw an exception, if
the option is not on strict then treat it as not encoded.
> More tolerant handling of unsupported Content-Coding
> ----------------------------------------------------
>
> Key: HTTPCLIENT-1643
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1643
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient
> Affects Versions: 4.4.1
> Reporter: Julien Nioche
>
> The following URL can be fetched by curl
> {code}
> curl -I http://meta.ats.hrsmart.com/cgi-bin/a/alljobs.cgi
> HTTP/1.1 200 OK
> Date: Wed, 22 Apr 2015 15:49:52 GMT
> Server: Apache/1.3.33 (Debian GNU/Linux) mod_throttle/3.1.2 PHP/4.3.10-15
> mod_ssl/2.8.22 OpenSSL/0.9.7e
> P3P: CP="CAO DSP COR CUR HIS OUR IND STA"
> Content-Type: text/html; charset=iso-8859-1
> Content-Encoding: script
> {code}
> but not by HttpClient as the Content-Encoding value returned by the server is
> invalid. This results in a org.apache.http.client.ClientProtocolException
> being thrown.
> Instead of failing the whole fetch, couldn't you treat an illegal value like
> this to be empty or have a default value?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]