Skip to content

Conversation

@timothy-jeong
Copy link
Contributor

Summary

This PR updates the CORSMiddleware documentation to explain how to configure it globally.
By wrapping the entire Starlette application with CORSMiddleware, all responses—including error responses generated by unhandled exceptions—will consistently include the proper CORS headers. This change reflects recent discussions (see discussion #2876) and clarifies the recommended usage pattern for ensuring global CORS enforcement.

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

Copy link
Contributor

@adriangb adriangb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit, otherwise looks good to me!

Co-authored-by: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
@adriangb adriangb merged commit 708930c into Kludex:master Mar 4, 2025
5 checks passed
@adriangb
Copy link
Contributor

adriangb commented Mar 4, 2025

Thanks!

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.

2 participants