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

Inconsistent behavior of default charset in StringEntity and IOHelper.getCharsetFromContentType

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.23.1
    • Fix Version/s: None
    • Component/s: camel-http, camel-http4
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      In our product, we invoke the Odata endpoint of a different service, it uses an CSRF nonce. 

      So in one post requset, two thing happen, Fetch the CSRF nonce and Post the actual request. 

      Here on processing the response of Fetch, it sets the charset from IOHelper.getCharsetFromContentType. If there is no charset in the response header Content-Type, then UTF-8 is set to default. 
      Thus this charset gets put on the exchange object. and used further in the post request. 

      But when we are creating a request entity. in HttpProducer.createRequestEntity
      The default charset it uses is ISO-8859-1 which is correct as per HTTP 1.1 standard. 

        Attachments

        1. apache-camel-consume.zip
          28 kB
          saksham
        2. echoServer.zip
          0.6 kB
          saksham
        3. Screenshot 2021-03-24 at 09.42.10.png
          153 kB
          Claus Ibsen

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              saksham.verma saksham
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: