Test your CORS knowledge with a free interactive quiz — 19 questions with answers and explanations. No signup needed to play.
Question 1/5Score 0
What is the purpose of caching a preflight response via `Access-Control-Max-Age`?
Questions in this quiz
What is the purpose of caching a preflight response via `Access-Control-Max-Age`?
What is a "preflight request" in CORS, and when does the browser send one?
What defines an "origin" in the context of CORS/Same-Origin Policy?
What HTTP response header does a server use to explicitly allow a specific origin to access its resource via CORS?
What is a reasonable mental model for remembering "who fixes a CORS error" when debugging one?
What is a "simple request" in CORS terminology, and what criteria must a request meet to qualify (and thus skip preflight)?
What is the Same-Origin Policy that CORS relaxes, and what problem does it exist to solve?
What is the significance of a CORS error appearing in the browser console, specifically regarding whether the actual request reached the server?
What does the browser do if a cross-origin fetch/XHR request receives a response WITHOUT the expected `Access-Control-Allow-Origin` header (or with a mismatched value)?
What is the purpose of the `Access-Control-Allow-Methods` header in a CORS preflight response?
What is generally considered a security risk about using `Access-Control-Allow-Origin: *` (wildcard) on an API serving sensitive, user-specific data?
What is the relationship between CORS and API security more broadly — does correctly configuring CORS headers alone secure an API against malicious requests?
Gaps to close?
Read the curated CORS notes — core concepts, patterns, interview prep.