-
-
Notifications
You must be signed in to change notification settings - Fork 1k
feat: implement rfc9110 http status names #2939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
rfc9110 obsoletes the earlier rfc 7231. This document also includes some status codes that were previously only used for WebDAV and assigns more generic names to these status codes. ref: https://www.rfc-editor.org/rfc/rfc9110.html#name-changes-from-rfc-7231 The status code constants are updated to reflect the new naming and the old constants are kept for backwards compatibility - HTTP_413_CONTENT_TOO_LARGE, previously HTTP_413_REQUEST_ENTITY_TOO_LARGE - HTTP_414_URI_TOO_LONG, previously HTTP_414_REQUEST_URI_TOO_LONG - HTTP_416_RANGE_NOT_SATISFIABLE, previously HTTP_416_REQUESTED_RANGE_NOT_SATISFIABLE - HTTP_422_UNPROCESSABLE_CONTENT, previously HTTP_422_UNPROCESSABLE_ENTITY
Kludex
requested changes
Jun 13, 2025
starlette/status.py
Outdated
Comment on lines
75
to
79
# for backwards compatibility | ||
HTTP_413_REQUEST_ENTITY_TOO_LARGE = HTTP_413_CONTENT_TOO_LARGE | ||
HTTP_414_REQUEST_URI_TOO_LONG = HTTP_414_URI_TOO_LONG | ||
HTTP_416_REQUESTED_RANGE_NOT_SATISFIABLE = HTTP_416_RANGE_NOT_SATISFIABLE | ||
HTTP_422_UNPROCESSABLE_ENTITY = HTTP_422_UNPROCESSABLE_CONTENT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to use a __getattr__
on the module to check those. Please check the history on this file, you'll find how to implement it.
We need to do this: b133ab4 |
Kludex
approved these changes
Sep 13, 2025
Thanks! And sorry i did not fix the PR up myself. Typical drive-by-committer 😉 |
fajpunk
added a commit
to lsst-sqre/safir
that referenced
this pull request
Sep 17, 2025
Starlette deprecated the `HTTP_422_UNPROCESSABLE_ENTITY` constant and changed it to `HTTP_422_UNPROCESSABLE_CONTENT` in [this PR](Kludex/starlette#2939). We could either change this constant in our code, or just use the status code int directly. This PR uses status code directly here rather than the new constant in to avoid having to increase the lower bound on starlette. This is the choice that the FastAPI folks made in [this PR](https://github.com/fastapi/fastapi/pull/14077/files).
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
rfc9110 obsoletes the earlier rfc 7231. This document also includes some status codes that were previously only used for WebDAV and assigns more generic names to these status codes.
ref: https://www.rfc-editor.org/rfc/rfc9110.html#name-changes-from-rfc-7231
The status code constants are updated to reflect the new naming and the old constants are kept for backwards compatibility
Checklist