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

CORS OPTIONS fails for services with path params when using servlet component

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.16.0
    • 2.17.0
    • camel-swagger
    • Unknown

    Description

      With CORS enabled the preflight request for services using path params fails. I reproduced the issue by building the camel-example-swagger-java example in the source bundle and deploying to a local tomcat server.

      Eg.:
      $ curl -I -X OPTIONS http://localhost:8080/camel-example-swagger-java/rest/user/123
      HTTP/1.1 404 Not Found
      Server: Apache-Coyote/1.1
      Access-Control-Allow-Origin: *
      Access-Control-Allow-Methods: GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH
      Access-Control-Max-Age: 3600
      Access-Control-Allow-Headers: Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers

      However, ".../

      {id}

      " works:

      $ curl -I -X OPTIONS http://localhost:8080/camel-example-swagger-java/rest/user/%7Bid%7D
      HTTP/1.1 200 OK
      Server: Apache-Coyote/1.1
      Access-Control-Allow-Origin: *
      Access-Control-Allow-Methods: GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH
      Access-Control-Max-Age: 3600
      Access-Control-Allow-Headers: Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers
      Allow: OPTIONS,GET
      Content-Length: 0

      The issue was not present in 2.14.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            lynge Morten Lynge
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: