Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(9)

Side by Side Diff: Lib/http/__init__.py

Issue 26589: Add HTTP Response code 451
Patch Set: Created 3 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 from enum import IntEnum 1 from enum import IntEnum
2 2
3 __all__ = ['HTTPStatus'] 3 __all__ = ['HTTPStatus']
4 4
5 class HTTPStatus(IntEnum): 5 class HTTPStatus(IntEnum):
6 """HTTP status codes and reason phrases 6 """HTTP status codes and reason phrases
7 7
8 Status codes from the following RFCs are all observed: 8 Status codes from the following RFCs are all observed:
9 9
10 * RFC 7231: Hypertext Transfer Protocol (HTTP/1.1), obsoletes 2616 10 * RFC 7231: Hypertext Transfer Protocol (HTTP/1.1), obsoletes 2616
11 * RFC 6585: Additional HTTP Status Codes 11 * RFC 6585: Additional HTTP Status Codes
12 * RFC 3229: Delta encoding in HTTP 12 * RFC 3229: Delta encoding in HTTP
13 * RFC 4918: HTTP Extensions for WebDAV, obsoletes 2518 13 * RFC 4918: HTTP Extensions for WebDAV, obsoletes 2518
14 * RFC 5842: Binding Extensions to WebDAV 14 * RFC 5842: Binding Extensions to WebDAV
15 * RFC 7238: Permanent Redirect 15 * RFC 7238: Permanent Redirect
16 * RFC 2295: Transparent Content Negotiation in HTTP 16 * RFC 2295: Transparent Content Negotiation in HTTP
17 * RFC 2774: An HTTP Extension Framework 17 * RFC 2774: An HTTP Extension Framework
18 * RFC 7225: Status Code to Report Legal Obstacles
Martin Panter 2016/05/30 03:57:10 Wrong RFC number (should be 7725)
18 """ 19 """
19 def __new__(cls, value, phrase, description=''): 20 def __new__(cls, value, phrase, description=''):
20 obj = int.__new__(cls, value) 21 obj = int.__new__(cls, value)
21 obj._value_ = value 22 obj._value_ = value
22 23
23 obj.phrase = phrase 24 obj.phrase = phrase
24 obj.description = description 25 obj.description = description
25 return obj 26 return obj
26 27
27 # informational 28 # informational
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 UPGRADE_REQUIRED = 426, 'Upgrade Required' 105 UPGRADE_REQUIRED = 426, 'Upgrade Required'
105 PRECONDITION_REQUIRED = (428, 'Precondition Required', 106 PRECONDITION_REQUIRED = (428, 'Precondition Required',
106 'The origin server requires the request to be conditional') 107 'The origin server requires the request to be conditional')
107 TOO_MANY_REQUESTS = (429, 'Too Many Requests', 108 TOO_MANY_REQUESTS = (429, 'Too Many Requests',
108 'The user has sent too many requests in ' 109 'The user has sent too many requests in '
109 'a given amount of time ("rate limiting")') 110 'a given amount of time ("rate limiting")')
110 REQUEST_HEADER_FIELDS_TOO_LARGE = (431, 111 REQUEST_HEADER_FIELDS_TOO_LARGE = (431,
111 'Request Header Fields Too Large', 112 'Request Header Fields Too Large',
112 'The server is unwilling to process the request because its header ' 113 'The server is unwilling to process the request because its header '
113 'fields are too large') 114 'fields are too large')
115 UNAVAILABLE_FOR_LEGAL_REASONS = (451, 'Unavailable For Legal Reasons',
116 'The server is denying access to the '
117 'resource as a consequence of a legal demand')
114 118
115 # server errors 119 # server errors
116 INTERNAL_SERVER_ERROR = (500, 'Internal Server Error', 120 INTERNAL_SERVER_ERROR = (500, 'Internal Server Error',
117 'Server got itself in trouble') 121 'Server got itself in trouble')
118 NOT_IMPLEMENTED = (501, 'Not Implemented', 122 NOT_IMPLEMENTED = (501, 'Not Implemented',
119 'Server does not support this operation') 123 'Server does not support this operation')
120 BAD_GATEWAY = (502, 'Bad Gateway', 124 BAD_GATEWAY = (502, 'Bad Gateway',
121 'Invalid responses from another server/proxy') 125 'Invalid responses from another server/proxy')
122 SERVICE_UNAVAILABLE = (503, 'Service Unavailable', 126 SERVICE_UNAVAILABLE = (503, 'Service Unavailable',
123 'The server cannot process the request due to a high load') 127 'The server cannot process the request due to a high load')
124 GATEWAY_TIMEOUT = (504, 'Gateway Timeout', 128 GATEWAY_TIMEOUT = (504, 'Gateway Timeout',
125 'The gateway server did not receive a timely response') 129 'The gateway server did not receive a timely response')
126 HTTP_VERSION_NOT_SUPPORTED = (505, 'HTTP Version Not Supported', 130 HTTP_VERSION_NOT_SUPPORTED = (505, 'HTTP Version Not Supported',
127 'Cannot fulfill request') 131 'Cannot fulfill request')
128 VARIANT_ALSO_NEGOTIATES = 506, 'Variant Also Negotiates' 132 VARIANT_ALSO_NEGOTIATES = 506, 'Variant Also Negotiates'
129 INSUFFICIENT_STORAGE = 507, 'Insufficient Storage' 133 INSUFFICIENT_STORAGE = 507, 'Insufficient Storage'
130 LOOP_DETECTED = 508, 'Loop Detected' 134 LOOP_DETECTED = 508, 'Loop Detected'
131 NOT_EXTENDED = 510, 'Not Extended' 135 NOT_EXTENDED = 510, 'Not Extended'
132 NETWORK_AUTHENTICATION_REQUIRED = (511, 136 NETWORK_AUTHENTICATION_REQUIRED = (511,
133 'Network Authentication Required', 137 'Network Authentication Required',
134 'The client needs to authenticate to gain network access') 138 'The client needs to authenticate to gain network access')
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+