Cordova POST - Request Forbidden 403. Not reaching Dispatcher Servlet

假如想象 提交于 2019-11-28 11:43:53

Managed to fix this.

The issue was having a CORS filter in my tomcat web.xml (the tomcat global web.xml in conf). For a Cordova app that doesn't need to be there.

Cordova sends a request through having header "Origin : file://". If the CORS filter is set in Tomcat then the request will fail.

Removing the CORS filter from the web.xml works and I can now POST data.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!