Morten Lynge created CAMEL-9343:
-----------------------------------

             Summary: CORS OPTIONS fails for services with path params when 
using servlet component
                 Key: CAMEL-9343
                 URL: https://issues.apache.org/jira/browse/CAMEL-9343
             Project: Camel
          Issue Type: Bug
          Components: camel-swagger
    Affects Versions: 2.16.0
            Reporter: Morten Lynge


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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to