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 does `Access-Control-Expose-Headers` control, and why might a frontend need it?
  3. How does a typical Express.js (Node) server configure CORS using the popular `cors` npm package?
  4. What is a "preflight request" in CORS, and when does the browser send one?
  5. Why can't a frontend application simply "fix" a CORS error by changing something in its own client-side JavaScript code?
  6. What is the relationship between CORS and API security more broadly — does correctly configuring CORS headers alone secure an API against malicious requests?
  7. What is the Same-Origin Policy that CORS relaxes, and what problem does it exist to solve?
  8. What HTTP response header does a server use to explicitly allow a specific origin to access its resource via CORS?
  9. What defines an "origin" in the context of CORS/Same-Origin Policy?
  10. What is a reasonable mental model for remembering "who fixes a CORS error" when debugging one?
  11. What is a common development-environment workaround for CORS issues when a frontend dev server and a separate backend API run on different ports locally?
  12. What is CORS (Cross-Origin Resource Sharing)?
Gaps to close?
Read the curated CORS notes — core concepts, patterns, interview prep.
CORS notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web