From 4584069c8aa43a10bef8d0711fc4451599bb4dcf Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Fri, 9 Sep 2011 16:57:35 +0000 Subject: [PATCH] Fixed #16746 - added more HTTP code/string mappings. This moves the arbitrary line on which HTTP codes to include away from RFC 2616 and to the IANA assignments, thus picking up WebDAV and a couple others. Thanks to vfaronov for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16732 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/handlers/wsgi.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/django/core/handlers/wsgi.py b/django/core/handlers/wsgi.py index 56d2ba631c..a816cadc7b 100644 --- a/django/core/handlers/wsgi.py +++ b/django/core/handlers/wsgi.py @@ -16,10 +16,11 @@ from django.utils.log import getLogger logger = getLogger('django.request') -# See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html +# See http://www.iana.org/assignments/http-status-codes STATUS_CODE_TEXT = { 100: 'CONTINUE', 101: 'SWITCHING PROTOCOLS', + 102: 'PROCESSING', 200: 'OK', 201: 'CREATED', 202: 'ACCEPTED', @@ -27,6 +28,9 @@ STATUS_CODE_TEXT = { 204: 'NO CONTENT', 205: 'RESET CONTENT', 206: 'PARTIAL CONTENT', + 207: 'MULTI-STATUS', + 208: 'ALREADY REPORTED', + 226: 'IM USED', 300: 'MULTIPLE CHOICES', 301: 'MOVED PERMANENTLY', 302: 'FOUND', @@ -53,12 +57,20 @@ STATUS_CODE_TEXT = { 415: 'UNSUPPORTED MEDIA TYPE', 416: 'REQUESTED RANGE NOT SATISFIABLE', 417: 'EXPECTATION FAILED', + 422: 'UNPROCESSABLE ENTITY', + 423: 'LOCKED', + 424: 'FAILED DEPENDENCY', + 426: 'UPGRADE REQUIRED', 500: 'INTERNAL SERVER ERROR', 501: 'NOT IMPLEMENTED', 502: 'BAD GATEWAY', 503: 'SERVICE UNAVAILABLE', 504: 'GATEWAY TIMEOUT', 505: 'HTTP VERSION NOT SUPPORTED', + 506: 'VARIANT ALSO NEGOTIATES', + 507: 'INSUFFICIENT STORAGE', + 508: 'LOOP DETECTED', + 510: 'NOT EXTENDED', } class LimitedStream(object):