docs: CORS + Auth ミドルウェア登録順ルール (#90)#92
Merged
Merged
Conversation
CORS と Auth を同時使用する場合、CORSMiddleware を Auth より後に登録して 最外側に置かないと OPTIONS preflight が 401 になる問題をドキュメント化。 framework-modules.md(EN/JA)と new-project.md に完全な登録順コード例と CORS + Auth ルールの callout を追加。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/reference/framework-modules.mdに完全なミドルウェア登録順コード例を追加(add_middleware引数テーブル・CORS+Auth callout 含む)docs/ja/reference/framework-modules.mdに同内容の日本語版を追加docs/how-to/new-project.mdに Auth + CORS ミドルウェアのコード例と CORS+Auth ルールの callout を追加Background
FT4(snippets: ApiKey + CORS)で発見した摩擦 F-1。
CORSMiddleware と ApiKeyAuthMiddleware を同時使用した際、CORSMiddleware を先に登録すると Auth が最外側になり OPTIONS preflight が 401 になる。
Starlette の逆順ルール(後に登録 = 最外側)の組み合わせ固有の説明が不足していたため追記。
Test plan
Closes #90
🤖 Generated with Claude Code