DEV Community

Discussion on: Clarifying CORS - Cross-origin Resource Sharing

Collapse
 
alexparra profile image
Alex Parra • Edited

Hi!
A few notes...

OPTIONS requests won't be made for GET requests.

OPTIONS can be made for GET requests if they are not “simple”.
See: developer.mozilla.org/en-US/docs/W...

You should note that Access-Control-Allow-Origin header only prevents browsers from making requests to the API.

The browser still always makes the GET/POST/XXX request.
If CORS fails the browser blocks the received response.
From the API standpoint CORS is never evaluated and these requests show in logs as successful regardless of CORS failures.