Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-15026

Camel throws exception on HHTP response Content-Type header with additional info

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.21.0
    • Fix Version/s: 2.21.1
    • Component/s: camel-http4
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bslaterdk Benny Slater

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment