Cross-Origin Resource Sharing
Fleeting- External reference: https://developer.mozilla.org/en-US/docs/Glossary/CORS
CORS (Cross-Origin Resource Sharing) is a system, consisting of transmitting HTTP headers, that determines whether browsers block frontend JavaScript code from accessing responses for cross-origin requests
preflight request
- External reference: https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request
CORS preflight request is a CORS request that checks to see if the CORS protocol is understood and a server is aware using specific methods and headers
— https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request
It is an OPTIONS request, using three HTTP request headers:
- Access-Control-Request-Method,
- Access-Control-Request-Headers,
- and the Origin header.
— https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request
simple request
When providing the origin header, the server automatically returns the access-control-allow-XXXX headers and the browser won’t deal with the data in that case in the cors data is wrong.