Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions starlette/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
See HTTP Status Code Registry:
https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
And RFC 2324 - https://tools.ietf.org/html/rfc2324
And RFC 9110 - https://www.rfc-editor.org/rfc/rfc9110
"""

from __future__ import annotations
Expand Down Expand Up @@ -44,14 +44,14 @@
HTTP_410_GONE = 410
HTTP_411_LENGTH_REQUIRED = 411
HTTP_412_PRECONDITION_FAILED = 412
HTTP_413_REQUEST_ENTITY_TOO_LARGE = 413
HTTP_414_REQUEST_URI_TOO_LONG = 414
HTTP_413_CONTENT_TOO_LARGE = 413
HTTP_414_URI_TOO_LONG = 414
HTTP_415_UNSUPPORTED_MEDIA_TYPE = 415
HTTP_416_REQUESTED_RANGE_NOT_SATISFIABLE = 416
HTTP_416_RANGE_NOT_SATISFIABLE = 416
HTTP_417_EXPECTATION_FAILED = 417
HTTP_418_IM_A_TEAPOT = 418
HTTP_421_MISDIRECTED_REQUEST = 421
HTTP_422_UNPROCESSABLE_ENTITY = 422
HTTP_422_UNPROCESSABLE_CONTENT = 422
HTTP_423_LOCKED = 423
HTTP_424_FAILED_DEPENDENCY = 424
HTTP_425_TOO_EARLY = 425
Expand All @@ -72,6 +72,11 @@
HTTP_510_NOT_EXTENDED = 510
HTTP_511_NETWORK_AUTHENTICATION_REQUIRED = 511

# 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
Owner

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.


"""
WebSocket codes
Expand Down
Loading