You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Benson Margulies <bi...@gmail.com> on 2011/12/01 17:16:13 UTC

A moment of confusion about http headers and JAX-RS responses?

I should know this, but ...

The CORS spec says:

Split the value of the Origin header on the U+0020 SPACE character and
if any of the resulting tokens is not a case-sensitive match for any
of the values in list of origins do not set any additional headers and
terminate this set of steps.

Now, if I'm using JAX-RS to send back the response to one of these,
and the input was multiple origins, does

   responseBuilder.header("Origin", "a");
   responseBuilder.header("Origin", "b");

create the same sort of space-separated thing, or am I supposed to
glue for myself first?

Re: A moment of confusion about http headers and JAX-RS responses?

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 01/12/11 16:16, Benson Margulies wrote:
> I should know this, but ...
>
> The CORS spec says:
>
> Split the value of the Origin header on the U+0020 SPACE character and
> if any of the resulting tokens is not a case-sensitive match for any
> of the values in list of origins do not set any additional headers and
> terminate this set of steps.
>
> Now, if I'm using JAX-RS to send back the response to one of these,
> and the input was multiple origins, does
>
>     responseBuilder.header("Origin", "a");
>     responseBuilder.header("Origin", "b");
>
> create the same sort of space-separated thing, or am I supposed to
> glue for myself first?
That will result in

Origin: a, b

or may be
Origin: a
Origin: b

I believe we have a property which can be used to manage how multiple 
values are set. So probably responseBuilder.header("Origin", "a b c"); :-)

Cheers, Sergey