bpo-26589: Add http status code 451 (GH-15413)

This commit is contained in:
Raymond Hettinger 2019-08-23 10:19:15 -07:00 committed by GitHub
parent 120b707a6d
commit 8f080b0995
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 0 deletions

View file

@ -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: An HTTP Status Code to Report Legal Obstacles
* RFC 7540: Hypertext Transfer Protocol Version 2 (HTTP/2)
"""
def __new__(cls, value, phrase, description=''):
@ -114,6 +115,10 @@ class HTTPStatus(IntEnum):
'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,
'Unavailable For Legal Reasons',
'The server is denying access to the '
'resource as a consequence of a legal demand')
# server errors
INTERNAL_SERVER_ERROR = (500, 'Internal Server Error',