You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Stijn Van Bael (JIRA)" <ji...@apache.org> on 2015/04/09 16:21:12 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=14487412#comment-14487412 ] 

Stijn Van Bael commented on CAMEL-8373:
---------------------------------------

I have a similar issue with netty4-http. The OPTIONS request only returns following headers:

    Allow: OPTIONS,GET
    Content-Length: 0
    Content-Type: text/plain


I tried working around it in a similar way Florian did:

    from("netty4-http:http://0.0.0.0:8081/products?matchOnUriPrefix=true&httpMethodRestrict=OPTIONS")
            .setHeader("Access-Control-Allow-Origin", constant("*"))
            .setHeader("Access-Control-Allow-Methods", constant("GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH"))
            .setHeader("Access-Control-Allow-Headers", constant("Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers"))
            .setHeader("Allow", constant("GET, OPTIONS, POST, PATCH"));


but that makes things even more strange. None of the Access-Control-Allow-* headers are returned and now Allow only returns OPTIONS twice:

    Allow: OPTIONS,OPTIONS
    Content-Length: 0
    Content-Type: text/plain

> 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.2, 2.16.0
>
>
> 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)