bpo-30553: Add status code 421 (Misdirected Req.) to http.HTTPStatus by vmsp · Pull Request #2589 · python/cpython (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation11 Commits4 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

vmsp

@vmsp

JelleZijlstra

@@ -98,6 +99,8 @@ def __new__(cls, value, phrase, description=''):
'Cannot satisfy request range')
EXPECTATION_FAILED = (417, 'Expectation Failed',
'Expect condition could not be satisfied')
MISDIRECTED_REQUEST = (421, 'Misdirected Request',
'Server can not produce a response')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"cannot" should be one word (unless this is specified otherwise in the RFC)

@vmsp

berkerpeksag

@@ -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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add

.. versionchanged:: 3.7 Added 421 status code.

to the end of the file? You can adjust the "Added 421 status code." part if you want -- I just used it as an example :)

@@ -0,0 +1 @@
Add HTTP/2 status code 421 (Misdirected Request) to http.HTTPStatus.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add "Patch by Vitor Pereira.".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this new? I sent a patch a couple of months ago and wasn't asked to do this.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's not new. We always try to add contributor's name in the NEWS file. Our GitHub workflow is still new so it's normal to forget this step (or sometimes we skip it intentionally if the patch is trivial)

@@ -0,0 +1 @@
Add HTTP/2 status code 421 (Misdirected Request) to http.HTTPStatus.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http.HTTPStatus -> :class:`http.HTTPStatus`

@bedevere-bot

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@vmsp

@vmsp

I have made the requested changes; please review again

@bedevere-bot

Thanks for making the requested changes!

@berkerpeksag: please review the changes made to this pull request.

@berkerpeksag

berkerpeksag

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!. I just made a small markup tweak and will merge it once Travis CI is happy.

@vmsp