All quizzes
Free quiz · 19 questions in the bank

CORS quiz

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
  1. What is the purpose of caching a preflight response via `Access-Control-Max-Age`?
  2. What is a "preflight request" in CORS, and when does the browser send one?
  3. What defines an "origin" in the context of CORS/Same-Origin Policy?
  4. What HTTP response header does a server use to explicitly allow a specific origin to access its resource via CORS?
  5. What is a reasonable mental model for remembering "who fixes a CORS error" when debugging one?
  6. What is a "simple request" in CORS terminology, and what criteria must a request meet to qualify (and thus skip preflight)?
  7. What is the Same-Origin Policy that CORS relaxes, and what problem does it exist to solve?
  8. What is the significance of a CORS error appearing in the browser console, specifically regarding whether the actual request reached the server?
  9. 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)?
  10. What is the purpose of the `Access-Control-Allow-Methods` header in a CORS preflight response?
  11. What is generally considered a security risk about using `Access-Control-Allow-Origin: *` (wildcard) on an API serving sensitive, user-specific data?
  12. 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.
CORS notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web