K
K
Konstantin2016-09-05 14:16:52
CORS
Konstantin, 2016-09-05 14:16:52

Cross-domain HTTP not working?

Throws Access-Control-Allow-Origin error. I am using OL3, GeoServer. The site itself is written in PHP, runs on Apache 2.2, I add an OL3 map with GeoServer to it. The map is displayed fine, but when I query it (I want to get the Name attribute of the layer ) it gives an error

XMLHttpRequest cannot load http://localhost:8080/geoserver/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFe…6.364518922%2C10857115.497626435%2C15578172.112632062%2C10857421.245739575. 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' is therefore not allowed access. The response had HTTP status code 403.

How can I configure Geoserver to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
fetis26, 2016-09-05
@Klass

You need to configure CORS
The simplest solution for GET is to give a header
Access-Control-Allow-Origin: *

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question