Hi,

It seems this was a previously reported bug that was supposedly fixed:

http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2404829

But I still get the problem: headers set in the ResponseBuilder JAX-RS object 
are ignored. Here's how my code looks:


@OPTIONS
Path("/foo")
public Response optionsRequest(@Context HttpHeaders headers, 
                               @Context Request request)
{
....
return Response.ok().header("Access-Control-Allow-Origin", origin)
        .header("Access-Control-Allow-Methods", method)
        .header("Content-Type", "application/json")
        .header("Access-Control-Max-Age", 60000)
        .build();
}

I tried with 2.0.6 and latest 2.1 milestone, neither worked. I'm using Tomcat 
with servlet and JAX-RS extensions. So I tried getting to the 
HttpServletResponse contextual object as well, but I got a 
NotYetImplementedException from the Restlet framework.

Basically, I'm trying to implement Cross-Origin Resource Sharing. Am I doing 
something wrong? Any ideas how to achieve this with the Restlet framework, 
hopefully in a standard way through JAX-RS?

Regards,
Boris

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2725278

Reply via email to