You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Janshi Bhavsar
ff57f7b0e1
feat: automatically support HEAD method for all GET routes
Mirrors Starlette behaviour (Route.__init__ adds HEAD whenever GET is
present). HEAD requests on GET routes now return 200 with the correct
headers and an empty body, instead of 405 Method Not Allowed.
- APIRouter.add_api_route: auto-adds HEAD to route.methods when GET is
present; revokes it if an explicit @app.head() is later registered on
the same path so explicit handlers always take priority.
- fastapi/openapi/utils.py: skip HEAD in OpenAPI schema generation when
GET is also present — HEAD is implied by GET (RFC 9110) and is not a
separately documented OpenAPI operation.
- fastapi/utils.py: generate_unique_id excludes the auto-implied HEAD
from the operationId suffix so @app.get routes keep _get.
- tests/test_head_auto.py: 8 tests covering routing, empty body,
header parity, 405 on non-GET routes, and OpenAPI schema exclusion.
Fixes #1773
3 months ago
..
.agents/skills/ fastapi
📝 Update Skill, optimize context, trim and refactor into references (#15031)
4 months ago
_compat
👷 Add `ty` to precommit (#15091)
4 months ago
dependencies
👷 Add `ty` to precommit (#15091)
4 months ago
middleware
📝 Use `WSGIMiddleware` from `a2wsgi` instead of deprecated `fastapi.middleware.wsgi.WSGIMiddleware` (#14756)
5 months ago
openapi
feat: automatically support HEAD method for all GET routes
3 months ago
security
✏️ Fix typo for `client_secret` in OAuth2 form docstrings (#14946)
4 months ago
__init__.py
🔖 Release version 0.136.0
3 months ago
__main__.py
♻️ Add support for `pip install "fastapi[standard]"` with standard dependencies and `python -m fastapi` (#11935)
2 years ago
applications.py
🔥 Remove April Fool's `@app.vibe()` 🤪 (#15363)
3 months ago
background.py
🎨 Update internal types for Python 3.10 (#14898)
5 months ago
cli.py
👷 Add `ty` to precommit (#15091)
4 months ago
concurrency.py
♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564)
7 months ago
datastructures.py
👷 Add `ty` to precommit (#15091)
4 months ago
encoders.py
👷 Add `ty` to precommit (#15091)
4 months ago
exception_handlers.py
⬆️ Upgrade Starlette supported version range to >=0.40.0,<0.49.0 (#14077)
10 months ago
exceptions.py
🎨 Update internal types for Python 3.10 (#14898)
5 months ago
logger.py
🔊 Refactor logging (#781)
7 years ago
param_functions.py
👷 Add `ty` to precommit (#15091)
4 months ago
params.py
👷 Add `ty` to precommit (#15091)
4 months ago
py.typed
✨ add py.typed to ship typing information (#209)
7 years ago
requests.py
⬆ Require Pydantic > 1.0 (#1862)
6 years ago
responses.py
⬆️ Support free-threaded Python 3.14t (#15149)
3 months ago
routing.py
feat: automatically support HEAD method for all GET routes
3 months ago
sse.py
✨ Add support for Server Sent Events (#15030)
4 months ago
staticfiles.py
✨ Improve type annotations, add support for mypy --strict, internally and for external packages (#2547)
6 years ago
templating.py
✨ Improve type annotations, add support for mypy --strict, internally and for external packages (#2547)
6 years ago
testclient.py
✨ Improve type annotations, add support for mypy --strict, internally and for external packages (#2547)
6 years ago
types.py
🎨 Update internal types for Python 3.10 (#14898)
5 months ago
utils.py
feat: automatically support HEAD method for all GET routes
3 months ago
websockets.py
✨ Export `WebSocketState` in `fastapi.websockets` (#4376)
4 years ago