summaryrefslogtreecommitdiffstats
path: root/Lib/http/server.py
diff options
context:
space:
mode:
authorHynek Schlawack <hs@ox.cx>2012-05-16 07:51:07 (GMT)
committerHynek Schlawack <hs@ox.cx>2012-05-16 07:51:07 (GMT)
commit51b2ed51f0cc18a69a1d53eb9f0f088c99681afc (patch)
treeef8f6e076a8a3324f0ca29fc5bc3609fcf389acd /Lib/http/server.py
parent313fbe21068038099cc4e57ae4bcd9e8a06e8b43 (diff)
downloadcpython-51b2ed51f0cc18a69a1d53eb9f0f088c99681afc.zip
cpython-51b2ed51f0cc18a69a1d53eb9f0f088c99681afc.tar.gz
cpython-51b2ed51f0cc18a69a1d53eb9f0f088c99681afc.tar.bz2
#14809: Add HTTP status codes from RFC 6585 to http.server and http.client
Patch by EungJun Yi.
Diffstat (limited to 'Lib/http/server.py')
-rw-r--r--Lib/http/server.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/http/server.py b/Lib/http/server.py
index c1b0596..cb66f2b 100644
--- a/Lib/http/server.py
+++ b/Lib/http/server.py
@@ -573,7 +573,7 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
# Table mapping response codes to messages; entries have the
# form {code: (shortmessage, longmessage)}.
- # See RFC 2616.
+ # See RFC 2616 and 6585.
responses = {
100: ('Continue', 'Request received, please continue'),
101: ('Switching Protocols',
@@ -628,6 +628,12 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
'Cannot satisfy request range.'),
417: ('Expectation Failed',
'Expect condition could not be satisfied.'),
+ 428: ('Precondition Required',
+ 'The origin server requires the request to be conditional.'),
+ 429: ('Too Many Requests', 'The user has sent too many requests '
+ 'in a given amount of time ("rate limiting").'),
+ 431: ('Request Header Fields Too Large', 'The server is unwilling to '
+ 'process the request because its header fields are too large.'),
500: ('Internal Server Error', 'Server got itself in trouble'),
501: ('Not Implemented',
@@ -638,6 +644,8 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
504: ('Gateway Timeout',
'The gateway server did not receive a timely response'),
505: ('HTTP Version Not Supported', 'Cannot fulfill request.'),
+ 511: ('Network Authentication Required',
+ 'The client needs to authenticate to gain network access.'),
}