[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light
/ cpython Public
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 and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-26589: Add http status code 451 #15413

Merged
merged 5 commits into from Aug 23, 2019
Merged

Conversation

Copy link
Contributor

rhettinger commented Aug 23, 2019

Previously given LGTM by R David Murray on 5/29/2016

https://bugs.python.org/issue26589

rhettinger requested review from bitdancer and vadmium Aug 23, 2019
@@ -114,6 +115,10 @@ def __new__(cls, value, phrase, description=''):
'Request Header Fields Too Large',
'The server is unwilling to process the request because its header '
'fields are too large')
UNAVAILABLE_FOR_LEGAL_REASONS = (451,
Copy link
Member

tirkarthi Aug 23, 2019

Choose a reason for hiding this comment

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

Please add this constant to list of tested constants like the previously added constant MISDIRECTED_REQUEST : https://github.com/python/cpython/pull/2589/files#diff-4334c6b7e8fcfc88f2555f65fa7ab337R1358

Copy link
Contributor Author

rhettinger Aug 23, 2019

Choose a reason for hiding this comment

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

Done.

@@ -106,6 +106,7 @@ Code Enum Name Details
``428`` ``PRECONDITION_REQUIRED`` Additional HTTP Status Codes :rfc:`6585`
``429`` ``TOO_MANY_REQUESTS`` Additional HTTP Status Codes :rfc:`6585`
``431`` ``REQUEST_HEADER_FIELDS_TOO_LARGE`` Additional HTTP Status Codes :rfc:`6585`
``451`` ``UNAVAILABLE_FOR_LEGAL_REASONS`` Status Code to Report Legal Obstacles :rfc:`7725`
Copy link
Contributor

epicfaace Aug 23, 2019

Choose a reason for hiding this comment

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

Perhaps you should change it to the title of the rfc for consistency?

Suggested change
``451`` ``UNAVAILABLE_FOR_LEGAL_REASONS`` Status Code to Report Legal Obstacles :rfc:`7725`
``451`` ``UNAVAILABLE_FOR_LEGAL_REASONS`` An HTTP Status Code to Report Legal Obstacles :rfc:`7725`

Copy link
Contributor Author

rhettinger Aug 23, 2019

Choose a reason for hiding this comment

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

Okay.

@@ -126,3 +127,6 @@ equal to the constant name (i.e. ``http.HTTPStatus.OK`` is also available as

.. versionchanged:: 3.7
Added ``421 MISDIRECTED_REQUEST`` status code.

.. versionadded:: 3.8
Copy link
Contributor

epicfaace Aug 23, 2019

Choose a reason for hiding this comment

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

Should this be:

Suggested change
.. versionadded:: 3.8
.. versionadded:: 3.9

Copy link
Contributor Author

rhettinger Aug 23, 2019

Choose a reason for hiding this comment

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

I'm backporting this to 3.8

@@ -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 7725: Status Code to Report Legal Obstacles
Copy link
Contributor

epicfaace Aug 23, 2019

Choose a reason for hiding this comment

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

Suggested change
* RFC 7725: Status Code to Report Legal Obstacles
* RFC 7725: An HTTP Status Code to Report Legal Obstacles

Copy link
Contributor Author

rhettinger Aug 23, 2019

Choose a reason for hiding this comment

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

Okay

Copy link
Member

tirkarthi left a comment

LGTM. Thanks.

rhettinger merged commit 8f080b0 into python:master Aug 23, 2019
rhettinger deleted the http451 branch Aug 23, 2019
Copy link
Contributor

miss-islington commented Aug 23, 2019

Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒🤖

Copy link
Contributor

miss-islington commented Aug 23, 2019

Sorry @rhettinger, I had trouble checking out the 3.8 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 8f080b09953a2d862de5c74edf414a54ea3dbea5 3.8

Copy link
Contributor

miss-islington commented Aug 23, 2019

Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒🤖

Copy link

bedevere-bot commented Aug 23, 2019

GH-15436 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 23, 2019
(cherry picked from commit 8f080b0)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
rhettinger added a commit that referenced this pull request Aug 23, 2019
(cherry picked from commit 8f080b0)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants