You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Benny Slater (Jira)" <ji...@apache.org> on 2020/05/07 11:49:00 UTC

[jira] [Created] (CAMEL-15026) Camel throws exception on HHTP response Content-Type header with additional info

Benny Slater created CAMEL-15026:
------------------------------------

             Summary: Camel throws exception on HHTP response Content-Type header with additional info
                 Key: CAMEL-15026
                 URL: https://issues.apache.org/jira/browse/CAMEL-15026
             Project: Camel
          Issue Type: Bug
          Components: camel-http4
    Affects Versions: 2.21.0
            Reporter: Benny Slater


Camel throws an TypeConversionException when receiving a HTTP response, where the Content-Type header includes extended information, e.g. version info.

org.apache.http.headers - [CID=879adbb4-d406-40e7-8529-5a20427157bf] - http-outgoing-0 << HTTP/1.1 400 Bad Request
org.apache.http.headers - [CID=879adbb4-d406-40e7-8529-5a20427157bf] - http-outgoing-0 << *Content-Type: application/json; charset=utf-8; v=1.0*
...

org.apache.camel.TypeConversionException: Error during type conversion from type: java.lang.String to the required type: java.lang.String with value [Body is instance of java.io.InputStream] due utf-8; v=1.0
....
Caused by: java.io.UnsupportedEncodingException: utf-8; v=1.0
 at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:71)

The exception throw is TypeConversionException and the response to the caller of route will get a 404 error back, even though the original response code was 400.

It appears that Camel doesn't handle the ; v=1.0 part of the content-type header.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)