Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
52ad72dd
Commit
52ad72dd
authored
Oct 26, 2017
by
Vitor Pereira
Committed by
Berker Peksag
Oct 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-30553: Add status code 421 to http.HTTPStatus (GH-2589)
parent
bdf4298a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
0 deletions
+10
-0
Doc/library/http.rst
Doc/library/http.rst
+4
-0
Lib/http/__init__.py
Lib/http/__init__.py
+3
-0
Lib/test/test_httplib.py
Lib/test/test_httplib.py
+1
-0
Misc/NEWS.d/next/Library/2017-07-05-14-48-26.bpo-30553.Oupsxo.rst
...S.d/next/Library/2017-07-05-14-48-26.bpo-30553.Oupsxo.rst
+2
-0
No files found.
Doc/library/http.rst
View file @
52ad72dd
...
...
@@ -98,6 +98,7 @@ Code Enum Name Details
``415`` ``UNSUPPORTED_MEDIA_TYPE`` HTTP/1.1 :rfc:`7231`, Section 6.5.13
``416`` ``REQUEST_RANGE_NOT_SATISFIABLE`` HTTP/1.1 Range Requests :rfc:`7233`, Section 4.4
``417`` ``EXPECTATION_FAILED`` HTTP/1.1 :rfc:`7231`, Section 6.5.14
``421`` ``MISDIRECTED_REQUEST`` HTTP/2 :rfc:`7540`, Section 9.1.2
``422`` ``UNPROCESSABLE_ENTITY`` WebDAV :rfc:`4918`, Section 11.2
``423`` ``LOCKED`` WebDAV :rfc:`4918`, Section 11.3
``424`` ``FAILED_DEPENDENCY`` WebDAV :rfc:`4918`, Section 11.4
...
...
@@ -122,3 +123,6 @@ In order to preserve backwards compatibility, enum values are also present
in the :mod:`http.client` module in the form of constants. The enum name is
equal to the constant name (i.e. ``http.HTTPStatus.OK`` is also available as
``http.client.OK``).
.. versionchanged:: 3.7
Added ``421 MISDIRECTED_REQUEST`` status code.
Lib/http/__init__.py
View file @
52ad72dd
...
...
@@ -15,6 +15,7 @@ class HTTPStatus(IntEnum):
* RFC 7238: Permanent Redirect
* RFC 2295: Transparent Content Negotiation in HTTP
* RFC 2774: An HTTP Extension Framework
* RFC 7540: Hypertext Transfer Protocol Version 2 (HTTP/2)
"""
def
__new__
(
cls
,
value
,
phrase
,
description
=
''
):
obj
=
int
.
__new__
(
cls
,
value
)
...
...
@@ -98,6 +99,8 @@ class HTTPStatus(IntEnum):
'Cannot satisfy request range'
)
EXPECTATION_FAILED
=
(
417
,
'Expectation Failed'
,
'Expect condition could not be satisfied'
)
MISDIRECTED_REQUEST
=
(
421
,
'Misdirected Request'
,
'Server is not able to produce a response'
)
UNPROCESSABLE_ENTITY
=
422
,
'Unprocessable Entity'
LOCKED
=
423
,
'Locked'
FAILED_DEPENDENCY
=
424
,
'Failed Dependency'
...
...
Lib/test/test_httplib.py
View file @
52ad72dd
...
...
@@ -1354,6 +1354,7 @@ class OfflineTest(TestCase):
'UNSUPPORTED_MEDIA_TYPE'
,
'REQUESTED_RANGE_NOT_SATISFIABLE'
,
'EXPECTATION_FAILED'
,
'MISDIRECTED_REQUEST'
,
'UNPROCESSABLE_ENTITY'
,
'LOCKED'
,
'FAILED_DEPENDENCY'
,
...
...
Misc/NEWS.d/next/Library/2017-07-05-14-48-26.bpo-30553.Oupsxo.rst
0 → 100644
View file @
52ad72dd
Add HTTP/2 status code 421 (Misdirected Request) to
:class:`http.HTTPStatus`. Patch by Vitor Pereira.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment