This question already has an answer here:
- Enabling CORS in GeoServer (jetty)? 5 answers
Using WMS I do a GetCapabilities request on a GeoServer instance. This works in FireFox, but not in Chrome, Safari, and Internet Explorer.
The point is that in the web.xml from the server I did add:
So the XML output does not have anything which will put the Access-Control-Allow-Origin header in.
And the case is that in any other request this not an issue, especially when I use jsonp in the jquery AJAX call.
However I didn't find any way to get the Capabilities in a JSON object. In other words I am stuck with XML and this doesn't seem to work.
Is there a way to do the request on jsonp? If not how do I set-up the server so that the GetCapabilities XML does use the Access-Control-Allow-Origin?