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

Charset not correctly set from content-type

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

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.12.4, 2.13.2, 2.14.0
    • 2.12.5, 2.13.3, 2.14.1, 2.15.0
    • camel-http4
    • None
    • Unknown

    Description

      When a "Content-Type" header is explicitely set with charset attached before invoking the camel http4 component, the charset is not taken into account.

      This is because ContentType.create is invoked with the complete Content-Type when in fact it expects a mediaType.

      (see lines 414-416: camel-http4 version 2.14.0)
      if (contentTypeString != null)

      { contentType = ContentType.create(contentTypeString); }

      For example, if header is set to "application/json; charset=UTF-8" the contentType returned by ContentType.create(contentTypeString) is null.

      And therefore, further down (line 444) charset is not extracted even though it has been specified.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            njiang Willem Jiang
            benjamin.habegger Benjamin Habegger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment