Skip to content

Allow CORS preflight with only origins configured - #423

Merged
lesnik512 merged 1 commit into
mainfrom
fix/383-cors-preflight
Nov 3, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
fix/383-cors-preflight

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Closes #383.

Default cors_allowed_methods to ["*"] so JSON POST preflights succeed with only allowed origins configured in FastAPI and Litestar. Keep the header default at [] and document both defaults.

Breaking changes

Applications that configure allowed origins and omit cors_allowed_methods now allow all standard HTTP methods through CORS preflight. Set an explicit list to restrict methods. The 2.x migration guide documents the change.

Verification

  • Both new preflight tests returned 400 before the fix and passed afterward.
  • just lint-ci, just test-ci (635 tests, 100% coverage), and just docs-build passed.

@lesnik512
lesnik512 merged commit 311ec5e into main Nov 3, 2026
35 checks passed
@lesnik512
lesnik512 deleted the fix/383-cors-preflight branch November 3, 2026 16:37
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.

Default cors_allowed_methods so a config with only origins passes preflight

1 participant