Tuesday, 15 May 2012

CORS filter gives 403 in POST only in Chrome -


I have followed the configuration in Tomcat. I receive a 403 error when requesting a post from remote machine to my local machine browser. I use EASYUI JQuery components, and they work fine on IE10 + and Firefox! Only Chrome is complaining about it. Can anyone have Hep?

  & lt; Filter & gt; & Lt; Filter-name & gt; CorsFilter & lt; / Filter-name & gt; & Lt; Filter range & gt; Org.apache.catalina.filters.CorsFilter & lt; / Filter range & gt; & Lt; / Filter & gt; & Lt; Filter-mapping & gt; & Lt; Filter-name & gt; CorsFilter & lt; / Filter-name & gt; & Lt; URL pattern & gt; / * & Lt; / URL pattern & gt; & Lt; / Filter-mapping & gt;  

The same problem was sending a JSON object through POST, and clear As a setting, a JSON content type header:

var config = {headers: {'Content-Type': 'application / json'}}; $ Http.post (url, config) .success ...

It seems Chrome is unable to detect content types and Firefox automatically.


No comments:

Post a Comment