incubator-baremaps icon indicating copy to clipboard operation
incubator-baremaps copied to clipboard

GeoJSON upload rises a CORS issue when an error occurs

Open fgravin opened this issue 3 years ago • 0 comments

When doing a POST to http://localhost:8080/studio/import, if an error occurs, it dispatches also a CORS issue.

Access to fetch at 'http://localhost:8080/studio/import' from origin 'http://localhost:3000' has been 
blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. 
If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch t
he resource with CORS disabled.

VM6656:1 POST http://localhost:8080/studio/import net::ERR_FAILED 500

If the request works (Status 200), there is no CORS issue, the CORS response header seems only added on success.

On 500 error, the response has no content and no header.

fgravin avatar Jan 12 '22 11:01 fgravin