[
https://issues.apache.org/jira/browse/CAMEL-8373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14487502#comment-14487502
]
ASF GitHub Bot commented on CAMEL-8373:
---------------------------------------
GitHub user stijnvanbael opened a pull request:
https://github.com/apache/camel/pull/471
Allows customizing the OPTIONS request.
Could be used as a workaround for CAMEL-8373:
rest("/products")
.verb("options")
.route()
.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"));
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/stijnvanbael/camel master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/471.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #471
----
commit d2520570f60bb13fecb14a504069c4d345785556
Author: Stijn Van Bael <[email protected]>
Date: 2015-04-09T15:10:09Z
Allows customizing the OPTIONS request. Could be used as a workaround for
CAMEL-8373:
rest("/products")
.verb("options")
.route()
.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"));
----
> 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)