This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add HTTP Response code 421
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, julienc, rhettinger, vmsp
Priority: normal Keywords:

Created on 2017-06-02 12:50 by julienc, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 2589 merged vmsp, 2017-07-05 13:55
Messages (5)
msg295013 - (view) Author: Julien (julienc) Date: 2017-06-02 12:50
The `http.HTTPStatus` class provides constants for most of the HTTP status codes.
Status code 421 was added by the RFC 7540 (HTTP/2), and is not part of this class. It is described as follows:

> The 421 (Misdirected Request) status code indicates that the request
> was directed at a server that is not able to produce a response.
> This can be sent by a server that is not configured to produce
> responses for the combination of scheme and authority that are
> included in the request URI.

Would it be possible to create the corresponding constant in `http.HTTPStatus`?

For reference:
* Status code 421 in the RFC 7540:
    https://tools.ietf.org/html/rfc7540#section-9.1.2
* Documentation on the HTTPStatus class in python 3.6:
    https://docs.python.org/3/library/http.html#http-status-codes
* Another opened issue relative to the status code 451 currently pending review:
    https://bugs.python.org/issue26589
msg297755 - (view) Author: Vitor Pereira (vmsp) * Date: 2017-07-05 13:56
I just submitted a PR, feel free to take a look.
msg297901 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-07-07 18:20
+1
msg305080 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-10-26 18:49
New changeset 52ad72dd0a5a56414cc29b7c9b03259169825f35 by Berker Peksag (Vitor Pereira) in branch 'master':
bpo-30553: Add status code 421 to http.HTTPStatus (GH-2589)
https://github.com/python/cpython/commit/52ad72dd0a5a56414cc29b7c9b03259169825f35
msg305081 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-10-26 18:50
Thank you Julien (for the report) and Vitor (for the patch)
History
Date User Action Args
2022-04-11 14:58:47adminsetgithub: 74738
2017-10-26 18:50:50berker.peksagsetstatus: open -> closed
versions: + Python 3.7, - Python 3.6
messages: + msg305081

resolution: fixed
stage: resolved
2017-10-26 18:49:21berker.peksagsetnosy: + berker.peksag
messages: + msg305080
2017-07-07 18:20:23rhettingersetnosy: + rhettinger
messages: + msg297901
2017-07-05 13:56:31vmspsetnosy: + vmsp
messages: + msg297755
2017-07-05 13:55:16vmspsetpull_requests: + pull_request2659
2017-06-02 12:50:32julienccreate