JettyHttpProducer - Should accept HTTP content type header may have quotes 
around charset, which some HTTP servers may return
-----------------------------------------------------------------------------------------------------------------------------

                 Key: CAMEL-4571
                 URL: https://issues.apache.org/jira/browse/CAMEL-4571
             Project: Camel
          Issue Type: Improvement
          Components: camel-jetty
    Affects Versions: 2.8.3
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
             Fix For: 2.9.0


Some HTTP servers may return back HTTP headers as
{code}
Content-Type : text/plain; charset="utf-8"
{code}

Notice the quotes around the charset.

This causes Jetty to fail when getting the response body with an exception
{code}
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)
{code}

We need to cater for this and remove quotes from charset.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to