A CORS-preflight request checks that a URL supports the CORS protocol before a more involved request
Answer: The CORS protocol sits on top of HTTP so a response can declare that it may be shared with another origin. Starlette's CORSMiddleware implements this on the server, with restrictive defaults.
What Fetch requires
A CORS request is an HTTP request that includes an Origin header. The protocol is opt-in so responses behind a firewall are not leaked by default.
Starlette's middleware
CORSMiddleware takes allow_origins as the list of permitted origins; ['*'] allows any origin. Defaults are restrictive.
Claims
- id: C1 claim: The CORS protocol is layered on top of HTTP. source: S1 evidence: "It is layered on top of HTTP"
- id: C2 claim: A more involved request is preceded by a CORS-preflight request. source: S1 evidence: "a CORS-preflight request is performed"
- id: C3 claim: CORSMiddleware defaults are restrictive. source: S2 evidence: "The default parameters used by the CORSMiddleware implementation are restrictive by default"
- id: C4 claim: allow_origins lists the origins allowed to make cross-origin requests. source: S2 evidence: "A list of origins that should be permitted to make cross-origin requests"
Sources
- [S1] Fetch Standard, CORS protocol. WHATWG. https://fetch.spec.whatwg.org/ . License: CC-BY-4.0. Accessed 2026-11-18.
- [S2] Starlette CORSMiddleware. Kludex/starlette (GitHub). https://github.com/Kludex/starlette/blob/main/docs/middleware.md . License: BSD-3-Clause. Accessed 2026-11-18.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: WHATWG, Fetch Standard, CORS protocol, CC-BY-4.0 (https://raw.githubusercontent.com/whatwg/fetch/main/LICENSE); Kludex/starlette (GitHub), Starlette CORSMiddleware, BSD-3-Clause (https://raw.githubusercontent.com/Kludex/starlette/main/LICENSE.md). Copyright (c) 2018, Encode OSS Ltd. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: WHATWG, Fetch Standard, CORS protocol, CC-BY-4.0 (https://raw.githubusercontent.com/whatwg/fetch/main/LICENSE); Kludex/starlette (GitHub), Starlette CORSMiddleware, BSD-3-Clause (https://raw.githubusercontent.com/Kludex/starlette/main/LICENSE.md). Copyright (c) 2018, Encode OSS Ltd.
Cite this
iinventedlight. 2026. "A CORS-preflight request checks that a URL supports the CORS protocol before a more involved request." iinventedlight Library, iil:note:7qjd8gdw, version of 2026-11-18. https://iinventedlight.com/library/notes/cors-preflight/. License: CC-BY-4.0.
@misc{iil_note_7qjd8gdw,
author = {{iinventedlight}},
title = {{A CORS-preflight request checks that a URL supports the CORS protocol before a more involved request}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-18},
url = {https://iinventedlight.com/library/notes/cors-preflight/},
note = {Permanent ID iil:note:7qjd8gdw. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/cors-preflight.md.