Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mbeijen
Copy link

@mbeijen mbeijen commented May 18, 2025

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

  • 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

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.

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
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
Copy link
Member

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.

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