Closed therter closed 4 years ago
seems to work now?
Where is the access done from? do you have an URL?
IMHO, when CORS errors happens they are because there is an access to a different server from the one providing the website. So this usually iis solved by including CORS headers in the website javascript which is trying to access another server (different domain name or even just different port)
Are you using react right?
Usually this is solved by adding the CORS headers which are:
Access-Control-Allow-Origin: https://www.mydomain.com
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Headers: Authorization, Content-Type
Content-Type: application/json
I am not sure how exactly do it but it should be something similar to this:
var allowCrossDomain = function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*"); // allow requests from any other server
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); // allow these verbs
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Cache-Control");
app.use(allowCrossDomain); // plumbing it in as middleware
With the * you are allowing any other server, but you can state specific ones (services.clarity-h2020.eu:8080 in our case)
Mmmmh I am checking buy maybe also Geoserver can include CORS policy to allow request from CSIS...
I included such CORS policy in our Tomcat configuration, give it a try please and let me know if anything improved.
Thank you, now the wms response contains the Access-Control-Allow-Origin header and the "Include in Report" button is working for this wms. So I can close this issue
I have added a "best practice describing how to do this.
The Access-Control-Allow-Origin header is not set again. See also here.
What is the status? This is also related to https://github.com/clarity-h2020/data-package/issues/66
It should be already solved, did you checked?
It should be already solved, did you checked?
No, this is not solved, yet. But perhaps this will be solved, when the new geoserver is used.
But perhaps this will be solved, when the new geoserver is used.
Yes. I assume that all layer will be served from https://geoserver.myclimateservice.eu/ See also https://github.com/clarity-h2020/data-package/issues/66#issuecomment-627198788
@therter did you check the screenshot functionality with the new geo server? Can we close this issue?
@therter did you check the screenshot functionality with the new geo server? Can we close this issue?
Yes, I have checked this and it works
Please add the Access-Control-Allow-Origin header to the wms (http://services.clarity-h2020.eu:8080/geoserver/clarity/ows?service=WMS&version=1.0.0&request=GetCapabilities), because at the moment we get the following error, when an image of a map with overlay layers from this wms will be created.
No Access-Control-Allow-Origin' header is present on the requested resource
Perhaps, this comment can help you