mirror of
https://github.com/python/cpython.git
synced 2025-08-28 04:35:02 +00:00
gh-102247: http: support rfc9110 status codes (GH-117611)
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 - http.HTTPStatus.CONTENT_TOO_LARGE (413, previously REQUEST_ENTITY_TOO_LARGE) - http.HTTPStatus.URI_TOO_LONG (414, previously REQUEST_URI_TOO_LONG) - http.HTTPStatus.RANGE_NOT_SATISFYABLE (416, previously REQUEST_RANGE_NOT_SATISFYABLE) - http.HTTPStatus.UNPROCESSABLE_CONTENT (422, previously UNPROCESSABLE_ENTITY) The new constants are added to http.HTTPStatus and the old constant names are preserved for backwards compatibility. References in documentation to the obsoleted rfc 7231 are updated
This commit is contained in:
parent
dd724239dd
commit
022ba6d161
6 changed files with 94 additions and 78 deletions
|
@ -651,22 +651,25 @@ class BasicTest(TestCase):
|
|||
'Client must specify Content-Length')
|
||||
PRECONDITION_FAILED = (412, 'Precondition Failed',
|
||||
'Precondition in headers is false')
|
||||
REQUEST_ENTITY_TOO_LARGE = (413, 'Request Entity Too Large',
|
||||
'Entity is too large')
|
||||
REQUEST_URI_TOO_LONG = (414, 'Request-URI Too Long',
|
||||
'URI is too long')
|
||||
CONTENT_TOO_LARGE = (413, 'Content Too Large',
|
||||
'Content is too large')
|
||||
REQUEST_ENTITY_TOO_LARGE = CONTENT_TOO_LARGE
|
||||
URI_TOO_LONG = (414, 'URI Too Long', 'URI is too long')
|
||||
REQUEST_URI_TOO_LONG = URI_TOO_LONG
|
||||
UNSUPPORTED_MEDIA_TYPE = (415, 'Unsupported Media Type',
|
||||
'Entity body in unsupported format')
|
||||
REQUESTED_RANGE_NOT_SATISFIABLE = (416,
|
||||
'Requested Range Not Satisfiable',
|
||||
RANGE_NOT_SATISFIABLE = (416,
|
||||
'Range Not Satisfiable',
|
||||
'Cannot satisfy request range')
|
||||
REQUESTED_RANGE_NOT_SATISFIABLE = RANGE_NOT_SATISFIABLE
|
||||
EXPECTATION_FAILED = (417, 'Expectation Failed',
|
||||
'Expect condition could not be satisfied')
|
||||
IM_A_TEAPOT = (418, 'I\'m a Teapot',
|
||||
'Server refuses to brew coffee because it is a teapot.')
|
||||
MISDIRECTED_REQUEST = (421, 'Misdirected Request',
|
||||
'Server is not able to produce a response')
|
||||
UNPROCESSABLE_ENTITY = 422, 'Unprocessable Entity'
|
||||
UNPROCESSABLE_CONTENT = 422, 'Unprocessable Content'
|
||||
UNPROCESSABLE_ENTITY = UNPROCESSABLE_CONTENT
|
||||
LOCKED = 423, 'Locked'
|
||||
FAILED_DEPENDENCY = 424, 'Failed Dependency'
|
||||
TOO_EARLY = 425, 'Too Early'
|
||||
|
@ -1718,13 +1721,17 @@ class OfflineTest(TestCase):
|
|||
'GONE',
|
||||
'LENGTH_REQUIRED',
|
||||
'PRECONDITION_FAILED',
|
||||
'CONTENT_TOO_LARGE',
|
||||
'REQUEST_ENTITY_TOO_LARGE',
|
||||
'URI_TOO_LONG',
|
||||
'REQUEST_URI_TOO_LONG',
|
||||
'UNSUPPORTED_MEDIA_TYPE',
|
||||
'RANGE_NOT_SATISFIABLE',
|
||||
'REQUESTED_RANGE_NOT_SATISFIABLE',
|
||||
'EXPECTATION_FAILED',
|
||||
'IM_A_TEAPOT',
|
||||
'MISDIRECTED_REQUEST',
|
||||
'UNPROCESSABLE_CONTENT',
|
||||
'UNPROCESSABLE_ENTITY',
|
||||
'LOCKED',
|
||||
'FAILED_DEPENDENCY',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue