summaryrefslogtreecommitdiffstats
path: root/Lib/http/__init__.py
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2019-08-23 17:19:15 (GMT)
committerGitHub <noreply@github.com>2019-08-23 17:19:15 (GMT)
commit8f080b09953a2d862de5c74edf414a54ea3dbea5 (patch)
tree3b6b0ac4d6ae181dc5e1150fba3c9e3021ca3e91 /Lib/http/__init__.py
parent120b707a6d43452e067daa55a8fdca69f9424abc (diff)
downloadcpython-8f080b09953a2d862de5c74edf414a54ea3dbea5.zip
cpython-8f080b09953a2d862de5c74edf414a54ea3dbea5.tar.gz
cpython-8f080b09953a2d862de5c74edf414a54ea3dbea5.tar.bz2
bpo-26589: Add http status code 451 (GH-15413)
Diffstat (limited to 'Lib/http/__init__.py')
-rw-r--r--Lib/http/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/http/__init__.py b/Lib/http/__init__.py
index e14a1eb..350afe7 100644
--- a/Lib/http/__init__.py
+++ b/Lib/http/__init__.py
@@ -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',