jira-importer opened a new issue, #1515:
URL: https://github.com/apache/httpcomponents-core/issues/1515

   
**[Viktor](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=popsul)**
 opened 
**[HTTPCORE-323](https://issues.apache.org/jira/browse/HTTPCORE-323?redirect=false)**
 and commented
   
   I have an wrong instance of HttpEntity, with illegal field "charset" 
(Content-Type: text/html; charset=cp-1251) in Content-Type header, and if 
ContentType.getOrDefault(entity) called with that entity - method throwing an 
uncaught exception:
   
   java.nio.charset.UnsupportedCharsetException: cp-1251
   at java.nio.charset.Charset.forName(Charset.java:543)
   at org.apache.http.entity.ContentType.create(ContentType.java:180)
   at org.apache.http.entity.ContentType.create(ContentType.java:190)
   at org.apache.http.entity.ContentType.get(ContentType.java:233)
   at org.apache.http.entity.ContentType.getOrDefault(ContentType.java:249)
   at org.apache.http.util.EntityUtils.toString(EntityUtils.java:212)
   at org.apache.http.util.EntityUtils.toString(EntityUtils.java:264)
   at com.rinamika.riwl.crawler.impl.LoaderImpl.processPage(LoaderImpl.java:131)
   ...
   
   I  suppose that it's not right behavior because method getOrDefault must be 
return a defaul value if something happened.
   
   Sorry for my English.
   
   
   ---
   
   **Affects:** 4.2.2
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to