Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.8.0
-
None
-
Unknown
Description
Some HTTP servers may return back HTTP headers as
Content-Type : text/plain; charset="utf-8"
Notice the quotes around the charset.
This causes Jetty to fail when getting the response body with an exception
java.io.UnsupportedEncodingException: "utf-8" at java.lang.StringCoding.decode(StringCoding.java:170)[:1.6.0_26] at java.lang.String.<init>(String.java:443)[:1.6.0_26] at java.io.ByteArrayOutputStream.toString(ByteArrayOutputStream.java:187)[:1.6.0_26] at org.eclipse.jetty.client.ContentExchange.getResponseContent(ContentExchange.java:51)[110:org.eclipse.jetty.client:7.4.1.v20110513] at org.apache.camel.component.jetty.JettyContentExchange.getBody(JettyContentExchange.java:122)
We need to cater for this and remove quotes from charset.