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

camel-core - Rest DSL Narrow content-type with charset fails clientRequestValidation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.2.0
    • 3.22.2, 4.3.0
    • camel-core, rest
    • None
    • Unknown

    Description

      We recently upgraded an application to latest camel stable and got an error report from consumers when submitting a charset parameter in the content type header. 

       

      Expected: a request with content-type header `application/xml; charset=utf-8` is correctly validated as part of a rest specification with `.consumes(MediaType.APPLICATION_XML_VALUE)`. We run with bindingmode.off 

      Actual: fails with 415 MediaType error

      What changed? 

      In commit https://github.com/apache/camel/commit/2ce60e76a5c8496c1468558e0b6d3043c4eb0eac a change in client Request Validation was introduced which defaults validation to return false instead of true.

       

      The charset parameter is part of the Content-Type superset and is not per se a MediaType. We expect setting the correct MediaType would lead to a validation of MediaType and not fail on an additional charset parameter.

      Attachments

        1. tCYuXsuHaeo9.png
          80 kB
          Billy Jaime Beltran
        2. camel-20210-example.zip
          5 kB
          Billy Jaime Beltran

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              chrysophylax Billy Jaime Beltran
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: