tengtian
e852c1cd0d
Automatically support HEAD method for all GET routes
RFC 7231 §4.3.2 states that the server SHOULD send the same header fields
in response to a HEAD request as it would have sent for GET. Starlette
does this by default but FastAPI's APIRoute did not.
This adds automatic HEAD support by overriding matches() and handle() on
APIRoute to accept HEAD requests when the route has GET in its methods.
Key design decisions:
- HEAD is NOT added to self.methods, so it stays out of the OpenAPI schema
- Explicit HEAD routes still work and appear in OpenAPI when declared
- The match promotion only happens when HEAD is not already in methods,
so explicit @app.head() or methods=["GET","HEAD"] are unaffected
- POST/PUT/DELETE/PATCH routes are not affected
Closes #1773
4 months ago
Sebastián Ramírez
9a9c4ad5d0
🔖 Release version 0.137.0 ( #15748 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
github-actions[bot]
c6d5897826
📝 Update release notes
[skip ci]
2 months ago
Sebastián Ramírez
31d097f286
📝 Update release notes ( #15747 )
2 months ago
github-actions[bot]
ba609a8946
📝 Update release notes
[skip ci]
2 months ago
Sebastián Ramírez
8e1d774cef
♻️ Refactor internals to preserve `APIRouter` and `APIRoute` instances ( #15745 )
2 months ago
github-actions[bot]
016ab760fa
📝 Update release notes
[skip ci]
2 months ago
Sebastián Ramírez
e2fcd5562f
🔧 Update sponsors: remove TalorData ( #15744 )
2 months ago
github-actions[bot]
d3e6a2931f
📝 Update release notes
[skip ci]
2 months ago
Sebastián Ramírez
e4b6a36c4f
🔧 Update sponsors: remove ExoFlare ( #15736 )
2 months ago
github-actions[bot]
944fb70622
📝 Update release notes
[skip ci]
2 months ago
Sebastián Ramírez
5d2dae82c4
🔧 Update sponsors: remove InterviewPal ( #15735 )
2 months ago
github-actions[bot]
e680fd6c8c
📝 Update release notes
[skip ci]
2 months ago
Sebastián Ramírez
ee036a111e
🔧 Update sponsors: remove Liblab ( #15731 )
2 months ago
github-actions[bot]
b98fb552e6
📝 Update release notes
[skip ci]
2 months ago
Sebastián Ramírez
e52919282a
🔧 Update sponsors: remove Scalar ( #15730 )
2 months ago
github-actions[bot]
b31720337a
📝 Update release notes
[skip ci]
2 months ago
dependabot[bot]
e133ffbc1b
⬆ Bump the python-packages group across 1 directory with 6 updates ( #15721 )
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 months ago
github-actions[bot]
4be770779e
📝 Update release notes
[skip ci]
2 months ago
dependabot[bot]
2015b63561
⬆ Bump python-multipart from 0.0.29 to 0.0.30 ( #15723 )
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <[email protected] >
2 months ago
github-actions[bot]
3c5d5bb497
📝 Update release notes
[skip ci]
2 months ago
dependabot[bot]
13b2b4cb34
⬆ Bump the github-actions group with 3 updates ( #15720 )
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <[email protected] >
2 months ago
github-actions[bot]
b6ed4666fe
📝 Update release notes
[skip ci]
2 months ago
dependabot[bot]
8b80abfbf3
⬆ Bump starlette from 1.1.0 to 1.2.1 ( #15722 )
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 months ago
github-actions[bot]
e42d913c60
📝 Update release notes
[skip ci]
2 months ago
dependabot[bot]
0cf3f76e7c
⬆ Bump https://github.com/crate-ci/typos from v1.46.0 to v1.47.1 in the pre-commit group ( #15719 )
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <[email protected] >
2 months ago
github-actions[bot]
706e20da5e
📝 Update release notes
[skip ci]
2 months ago
Alejandra
71ea74fb8f
📝 Update FastAPI Cloud deployment instructions ( #15724 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
github-actions[bot]
5cdf820c80
📝 Update release notes
[skip ci]
2 months ago
Sebastián Ramírez
782476e7db
🔧 Update sponsors, add Rapidproxy ( #15689 )
2 months ago
github-actions[bot]
7eb2bf5c4e
📝 Update release notes
[skip ci]
2 months ago
Sebastián Ramírez
b3b6aba5ab
🔧 Update sponsors: Remove TestMu ( #15688 )
2 months ago
github-actions[bot]
433a7ef39b
📝 Update release notes
[skip ci]
2 months ago
dependabot[bot]
df3c778ae6
⬆ Bump the python-packages group across 1 directory with 11 updates ( #15683 )
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 months ago
github-actions[bot]
09e615a6fc
📝 Update release notes
[skip ci]
2 months ago
dependabot[bot]
81c243f86d
⬆ Bump aiohttp from 3.13.4 to 3.14.0 ( #15681 )
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 months ago
github-actions[bot]
5d2320fca6
📝 Update release notes
[skip ci]
2 months ago
dependabot[bot]
e95d3aab28
⬆ Bump the github-actions group with 2 updates ( #15682 )
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 months ago
github-actions[bot]
2441eff837
📝 Update release notes
[skip ci]
2 months ago
dependabot[bot]
460f8d2cc8
⬆ Bump starlette from 1.0.0 to 1.1.0 ( #15684 )
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 months ago
github-actions[bot]
3d2aace42f
📝 Update release notes
[skip ci]
2 months ago
github-actions[bot]
566bc53187
📝 Update release notes
[skip ci]
2 months ago
Sebastián Ramírez
4cc0e5b3ce
🌐 Update translations for zh-hant (update-outdated) ( #15671 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Sebastián Ramírez
d144531caa
🌐 Update translations for es (update-outdated) ( #15670 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
github-actions[bot]
57b42cc138
📝 Update release notes
[skip ci]
2 months ago
Sebastián Ramírez
2d5e2a4b29
🌐 Update translations for fr (update-outdated) ( #15669 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
github-actions[bot]
6999d21e98
📝 Update release notes
[skip ci]
2 months ago
Sebastián Ramírez
c4cf1341a1
👥 Update FastAPI People - Experts ( #15677 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
github-actions[bot]
a5a68f14e7
📝 Update release notes
[skip ci]
2 months ago
Sebastián Ramírez
6926656247
👥 Update FastAPI GitHub topic repositories ( #15675 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago