cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benson Margulies <>
Subject Re: Failing to set an Origin header with a WebClient
Date Wed, 30 Nov 2011 19:54:19 GMT
I dumped the exchange, and Origin isn't in there. I haven't turned on
the logging interceptors yet.

[null, null, null, null, null, null, null, null, null,
Cache-Control=[no-cache], connection=[keep-alive], content-type=[*/*],
Host=[localhost:9000], Pragma=[no-cache], User-Agent=[Apache CXF
${project.version}]}, null, null, null, null, null, null,
null, null, null, null,
org.apache.cxf.request.uri=/simpleGet/HelloThere, null,
org.apache.cxf.resource.method=public java.lang.String
HTTP.REQUEST=(GET /simpleGet/HelloThere)@372285153
org.eclipse.jetty.server.Request@16309ee1, null, null,
Accept=text/plain, null,
org.apache.cxf.message.Message.PATH_INFO=/simpleGet/HelloThere, null,
null, null, null, null, null, null, null,
null, null, null,
null, null, org.apache.cxf.message.Message.QUERY_STRING=null,

On Wed, Nov 30, 2011 at 2:47 PM, Benson Margulies <> wrote:
> I'm failing to set an Origin header with a WebClient. Here's the
> client side code, and the header does not make it to the other end.
> This makes it rather difficult to write tests for CORS.
> On the other hand, should WebClient have native support for the client
> side of CORS? That's complex and unpleasant in prospect.
>        String origin = "http://localhost:" + PORT;
>        WebClient wc = WebClient.create(origin + "/");
>        // Since our WebClient doesn't know from Origin, we need to do
> this ourselves.
>        wc.header("Origin", origin);
>        Response r =
> wc.replacePath("/simpleGet/HelloThere").accept("text/plain").get();
>        assertEquals(Response.Status.OK.getStatusCode(), r.getStatus());

View raw message