I'm working with Geoserver 2.12.1 (Windows Installer Version) and I had to enable CORS before for getting access when I attempted to do a GetFeatureInfo.
I did the steps to enable CORS:
- Edit
webapps/geoserver/WEB-INF/web.xml:
<filter> <filter-name>cross-origin</filter-name> <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class> <init-param> <param-name>allowedOrigins</param-name> <param-value>*</param-value> </init-param> <init-param> <param-name>allowedMethods</param-name> <param-value>GET,POST,DELETE,PUT,HEAD,OPTIONS</param-value> </init-param> <init-param> <param-name>allowedHeaders</param-name> <param-value>origin, content-type, accept</param-value> </init-param> </filter> <!-- THIS FILTER MUST BE THE FIRST ONE, otherwise we end up with ruined chars in the input from the GUI See the "Note" in the Tomcat character encoding guide: http://wiki.apache.org/tomcat/FAQ/CharacterEncoding --> <filter-mapping> <filter-name>Set Character Encoding</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
Now, the GetFeatureInfo for WMS Service is working, but, I recently installed WPS Plugin and when I do some request to:
http://localhost:8080/geoserver/wps
It's not working. It's showing the following error:
Failed to load resource: the server responded with a status of 403 (Forbidden) (index):1 Failed to load http://localhost:8080/geoserver/wps: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 403. But I have it configured to accept all methods.
What could be the reason?