Back to the Catalog
cors
browser-security
cookies
csp
csrf
fetch

CORS: Why Is the Browser Blocking Me?

44 questions

Work through how browsers handle origins, CORS, preflights, credentials, opaque responses, SameSite cookies, CSP, CSRF, and the classic "but it works in Postman" trap.

Questions

  1. Not answered. Are these two URLs same-origin?
  2. Not answered. How are https://app.example.com and https://api.example.com related?
  3. Not answered. What does CORS control?
  4. Not answered. A form-style cross-origin POST changes server state, but the response has no CORS headers. What happens?
  5. Not answered. Which changes would trigger a CORS preflight?
  6. Not answered. Which cross-origin requests can avoid a CORS preflight?
  7. Not answered. Which request matches the preflight for a PATCH with Content-Type and X-Trace-Id?
  8. Not answered. Will a CORS preflight include the user's session cookie?
  9. Not answered. Can 204 No Content be a successful preflight response?
  10. Not answered. Your auth middleware returns 401 for every unauthenticated OPTIONS request. How should you fix it?
  11. Not answered. A preflight succeeds, then the actual PATCH returns 500 without Access-Control-Allow-Origin. What can browser JavaScript observe?
  12. Not answered. Why might clearing the normal HTTP cache leave a preflight result cached?
  13. Not answered. Why does Access-Control-Allow-Origin: * fail for fetch(url, { credentials: "include" })?
  14. Not answered. Which response header pair can share a credentialed response with a page at https://app.example.com?
  15. Not answered. Will Access-Control-Allow-Credentials: True authorize a credentialed CORS response?
  16. Not answered. Is Access-Control-Allow-Origin: https://a.example, https://b.example a valid two-origin allowlist?
  17. Not answered. Which cache header should you send when Access-Control-Allow-Origin changes with the request's Origin?
  18. Not answered. Why is it dangerous to copy any request Origin into Access-Control-Allow-Origin when credentials are enabled?
  19. Not answered. What is the default credentials mode for fetch("https://api.other.example/data")?
  20. Not answered. What does credentials: "include" guarantee for a cross-site cookie?
  21. Not answered. Can the browser accept Set-Cookie even when CORS prevents JavaScript from reading the response?
  22. Not answered. Does Access-Control-Allow-Headers: * allow an Authorization request header?
  23. Not answered. The Network panel shows X-Request-Id: abc, but response.headers.get("X-Request-Id") returns null. What is missing?
  24. Not answered. Can frontend JavaScript read Set-Cookie by asking the server to send Access-Control-Expose-Headers: Set-Cookie?
  25. Not answered. What numeric status does JavaScript observe on an opaque response?
  26. Not answered. What can JavaScript read from a successful cross-origin JSON response fetched with mode: "no-cors"?
  27. Not answered. Can a no-cors request have server-side effects even though JavaScript receives an opaque response?
  28. Not answered. Why can't a rejected fetch() promise reliably distinguish a CORS failure from a network failure?
  29. Not answered. What does "it works in the Postman desktop app" prove about a browser CORS failure?
  30. Not answered. Will a SameSite=Lax session cookie accompany a cross-site fetch() POST from another site?
  31. Not answered. When can a SameSite=Lax cookie be sent from a cross-site context?
  32. Not answered. What happens to Set-Cookie: session=abc; SameSite=None when the Secure attribute is absent?
  33. Not answered. A page on https://app.example.com fetches https://api.example.com. Which statements are true?
  34. Not answered. Can a browser withhold a cross-site cookie even when Fetch, SameSite, Secure, and CORS are configured correctly?
  35. Not answered. What protection does HttpOnly provide for a session cookie?
  36. Not answered. Why do cookie-authenticated endpoints still need CSRF protection when their CORS policy is strict?
  37. Not answered. Why does the page's inline script fail under Content-Security-Policy: script-src 'self'?
  38. Not answered. Which change allows this inline bootstrap script under CSP?
  39. Not answered. Why should a CSP nonce not be a constant copied into every response?
  40. Not answered. Why can one extra space break a CSP hash for an inline script?
  41. Not answered. The API returns correct CORS headers, but the page has Content-Security-Policy: connect-src 'self'. Why does the fetch still fail?
  42. Not answered. What does Content-Security-Policy: default-src 'self' imply for a cross-origin fetch() when no connect-src is present?
  43. Not answered. How can you test a proposed CSP without enforcing it?
  44. Not answered. Which limits apply when CSP is delivered through a <meta> element?