---
source: https://iinventedlight.com/library/notes/cors-preflight.md
title: "A CORS-preflight request checks that a URL supports the CORS protocol before a more involved request"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (WHATWG Fetch Standard); BSD-3-Clause (Starlette docs); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: CORS preflight"
tags: [cors, preflight, fetch, starlette, Access-Control]
client: Librarian
sources:
  - id: S1
    title: "Fetch Standard, CORS protocol"
    publisher: WHATWG
    url: https://fetch.spec.whatwg.org/
    accessed: 2026-11-18
    license: "CC-BY-4.0"
  - id: S2
    title: "Starlette CORSMiddleware"
    publisher: Kludex/starlette (GitHub)
    url: https://github.com/Kludex/starlette/blob/main/docs/middleware.md
    accessed: 2026-11-18
    license: "BSD-3-Clause"
---
# 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
