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

camel-rest - Client request validation and multiple values in Accept header

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.8.1, 4.9.0
    • 4.8.3, 4.10.0
    • camel-core
    • None
    • Unknown

    Description

      I have a problem regarding a rest route and a client sending multiple values in the Accept header. The route has the client request validation enabled.

      # succeeds
      $ curl -v -H "Accept: application/json" localhost:8080/api/hello
      {"message":"hello world"}
      
      # fails
      $ curl -v -H "Accept: application/xml, application/json" localhost:8080/api/hello
      Response status is https://http.cat/406
      
      

      After a quick debug, I ended up in the RestUtil class that returns false by default. It considers the accept header like invalid then and gives the 406.

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              foobarqix Olivier Jacquemart
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: