Ticket #481: wsgi.patch
File wsgi.patch, 1.6 KB (added by , 19 years ago) |
---|
-
wsgi.py
2 2 from django.utils import datastructures, httpwrappers 3 3 from pprint import pformat 4 4 5 # 6 # Status code definition. 7 # For details see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 8 # 9 5 10 STATUS_CODE_TEXT = { 11 100: 'CONTINUE', 12 101: 'SWITCHING PROTOCOLS', 6 13 200: 'OK', 14 201: 'CREATED', 15 202: 'ACCEPTED', 16 203: 'NON-AUTHORITATIVE INFORMATION', 17 204: 'NO CONTENT', 18 205: 'RESET CONTENT', 19 206: 'PARTIAL CONTENT', 20 300: 'MULTIPLE CHOICES', 21 301: 'MOVED PERMANENTLY', 22 302: 'FOUND', 23 303: 'SEE OTHER', 24 304: 'NOT MODIFIED', 25 305: 'USE PROXY', 26 306: 'RESERVED', 27 307: 'TEMPORARY REDIRECT', 28 400: 'BAD REQUEST', 29 401: 'UNAUTHORIZED', 30 402: 'PAYMENT REQUIRED', 31 403: 'FORBIDDEN', 7 32 404: 'NOT FOUND', 33 405: 'METHOD NOT ALLOWED', 34 406: 'NOT ACCEPTABLE', 35 407: 'PROXY AUTHENTICATION REQUIRED', 36 408: 'REQUEST TIMEOUT', 37 409: 'CONFLICT', 38 410: 'GONE', 39 411: 'LENGTH REQUIRED', 40 412: 'PRECONDITION FAILED', 41 413: 'REQUEST ENTITY TOO LARGE', 42 414: 'REQUEST-URI TOO LONG', 43 415: 'UNSUPPORTED MEDIA TYPE', 44 416: 'REQUESTED RANGE NOT SATISFIABLE', 45 417: 'EXPECTATION FAILED', 8 46 500: 'INTERNAL SERVER ERROR', 47 501: 'NOT IMPLEMENTED', 48 502: 'BAD GATEWAY', 49 503: 'SERVICE UNAVAILABLE', 50 504: 'GATEWAY TIMEOUT', 51 505: 'HTTP VERSION NOT SUPPORTED', 9 52 } 10 53 11 54 class WSGIRequest(httpwrappers.HttpRequest):