Skip to content

fix(web): CORS preflight bypasses security gate (v26.06.109)#141

Merged
ancongui merged 1 commit into
mainfrom
fix/cors-preflight-outermost
Jun 16, 2026
Merged

fix(web): CORS preflight bypasses security gate (v26.06.109)#141
ancongui merged 1 commit into
mainfrom
fix/cors-preflight-outermost

Conversation

@ancongui

Copy link
Copy Markdown
Contributor

CORSMiddleware is now the outermost middleware (ahead of the WebFilterChain holding the HttpSecurity gate) on both adapters, so a credential-less OPTIONS preflight to a gated route is answered by CORS (200 + Access-Control-* headers) instead of being 401'd by the gate — which made browsers report 'Load failed'. Regression test added (tests/web/test_cors.py). Bump v26.06.108 → v26.06.109.

🤖 Generated with Claude Code

…y gate (v26.06.109)

The CORSMiddleware is now prepended ahead of the WebFilterChain (which holds the
HttpSecurity gate) on both the Starlette and FastAPI adapters. Previously the
filter chain wrapped CORS, so a browser OPTIONS preflight (no credentials) to a
gated route was answered 401 without Access-Control-* headers and the browser
blocked the real request ('Load failed'). Regression test added.
@ancongui ancongui merged commit 0357813 into main Jun 16, 2026
6 checks passed
@ancongui ancongui deleted the fix/cors-preflight-outermost branch June 16, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant