PS: trunk should have a built in CORS filter -->
http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#CORS_Filter

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/8/14 Romain Manni-Bucau <[email protected]>

> Hi
>
> do you have a project (client+server) reproducing it?
>
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
>
>
> 2013/8/14 friday <[email protected]>
>
>> Hi,
>>
>> I created a filter to handle the CORS stuff, but it is not triggered on
>> OPTIONS request. All other requests all filtered well.
>>
>> My Environment is: tomee+ 1.6.0-SNAPSHOT
>>
>> My filter class:
>>
>> @WebFilter("/*")
>> public class CORSFilter implements Filter {
>>
>>     public CORSFilter() {
>>     }
>>
>>     public void init(FilterConfig fc) throws ServletException {
>>     }
>>
>>     public void destroy() {
>>     }
>>
>>     public void doFilter(ServletRequest request, ServletResponse response,
>>                          FilterChain chain) throws IOException,
>> ServletException {
>>
>>         HttpServletResponse r = (HttpServletResponse) response;
>>         r.setHeader("Access-Control-Allow-Origin", "*");
>>         r.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT,
>> DELETE,
>> OPTIONS");
>>         r.setHeader("Access-Control-Allow-Credentials", "true");
>>         r.setHeader("Access-Control-Allow-Headers", "accept, origin,
>> content-type");
>>
>>         chain.doFilter(request, response);
>>     }
>> }
>>
>>
>>
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/WebFilter-did-not-trigger-on-OPTIONS-Request-tp4664644.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>
>

Reply via email to