You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Davy De Waele (JIRA)" <ji...@apache.org> on 2015/03/23 15:45:11 UTC

[jira] [Commented] (CAMEL-8373) rest-dsl - CORS may have issue with non simple requests

    [ https://issues.apache.org/jira/browse/CAMEL-8373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14375984#comment-14375984 ] 

Davy De Waele commented on CAMEL-8373:
--------------------------------------

Even for simple GET requests I cannot get this to work, as the pre-flight OPTIONS doesn't contain the correct CORs headers.

I noticed that the camel-example-servlet-rest-tomcat sample uses the RestSwaggerCorsFilter (https://github.com/apache/camel/blob/master/examples/camel-example-servlet-rest-tomcat/src/main/webapp/WEB-INF/web.xml) to achieve CORS (and not the enableCors flag on the restConfiguration).

With that example CORs works out of the box due to the Swagger filter. 

If you enableCORS on the restConfiguration it will fail because you'll have both the REST component and the restConfiguration putting CORs headers on the response.

Might be interesting to use this example to demonstrate the enableCORS flag.

> rest-dsl - CORS may have issue with non simple requests
> -------------------------------------------------------
>
>                 Key: CAMEL-8373
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8373
>             Project: Camel
>          Issue Type: Task
>          Components: camel-core
>    Affects Versions: 2.14.1
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.15.1
>
>
> Look into reported on SO
> http://stackoverflow.com/questions/28562817/camel-rest-dsl-enablecors-only-working-for-get
> For non simple requests, such as PUT see
> http://www.w3.org/TR/cors/



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