What is CORS and who enforces it?
IntermediateConceptHTTP, TLS & Certificates
Answer
Cross-Origin Resource Sharing is a browser mechanism. A page on one origin calling another origin's API needs Access-Control-Allow-Origin (and others) in the response; for non-simple requests the browser first sends an OPTIONS preflight.
It is not a server-side security control: curl ignores it. Do not reflect arbitrary Origin values with credentials enabled.
More on HTTP, TLS & Certificates
What is the structure of an HTTP request and response?BeginnerWhich HTTP status code classes and codes should every DevOps engineer know?BeginnerWhat are the common HTTP methods and which are idempotent?BeginnerWhat changed between HTTP/1.1, HTTP/2 and HTTP/3?IntermediateHow does QUIC differ from TCP+TLS?AdvancedWhat are HTTP keep-alive and connection reuse, and why do they matter?Advanced