You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dmitriyC300 <dm...@gmail.com> on 2016/08/16 02:22:12 UTC

Rest DSL & CORS

Hi Guys,
Is there a way to dynamically set/reset Access-Control-Allow-Origin response
header based on incoming request's Origin header?  It looks like static
setting can be applied via rest configuration, but I couldn't figure out how
to do it dynamically apart from managing response CORS headers directly.

In the use case I am trying to allow cross origin requests from a limited
list of known domains/sub-domains, but cannot use "*" for security reasons
when credential flag is enabled.

"Response to preflight request doesn't pass access control check: A wildcard
'*' cannot be used in the 'Access-Control-Allow-Origin' header when the
credentials flag is true."

Dmitriy



--
View this message in context: http://camel.465427.n5.nabble.com/Rest-DSL-CORS-tp5786416.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Rest DSL & CORS

Posted by Claus Ibsen <cl...@gmail.com>.
You can try set a header with the value you want.

The CORS in Camel may preserve existing headers (cannot remember)

On Tue, Aug 16, 2016 at 4:22 AM, dmitriyC300 <dm...@gmail.com> wrote:
> Hi Guys,
> Is there a way to dynamically set/reset Access-Control-Allow-Origin response
> header based on incoming request's Origin header?  It looks like static
> setting can be applied via rest configuration, but I couldn't figure out how
> to do it dynamically apart from managing response CORS headers directly.
>
> In the use case I am trying to allow cross origin requests from a limited
> list of known domains/sub-domains, but cannot use "*" for security reasons
> when credential flag is enabled.
>
> "Response to preflight request doesn't pass access control check: A wildcard
> '*' cannot be used in the 'Access-Control-Allow-Origin' header when the
> credentials flag is true."
>
> Dmitriy
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Rest-DSL-CORS-tp5786416.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2