Code

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#481 closed enhancement (fixed)

[patch] additional http status codes

Reported by: eugene@… Owned by: adrian
Component: Core (Other) Version:
Severity: trivial Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Full list of http status calls is added. I got tired to debug my code and see 30x codes as UNKNOWN STATUS CODE.

Index: wsgi.py
===================================================================
--- wsgi.py	(revision 632)
+++ wsgi.py	(working copy)
@@ -2,10 +2,53 @@
 from django.utils import datastructures, httpwrappers
 from pprint import pformat
 
+#
+# Status code definition.
+# For details see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
+#
+
 STATUS_CODE_TEXT = {
+    100: 'CONTINUE',
+    101: 'SWITCHING PROTOCOLS',
     200: 'OK',
+    201: 'CREATED',
+    202: 'ACCEPTED',
+    203: 'NON-AUTHORITATIVE INFORMATION',
+    204: 'NO CONTENT',
+    205: 'RESET CONTENT',
+    206: 'PARTIAL CONTENT',
+    300: 'MULTIPLE CHOICES',
+    301: 'MOVED PERMANENTLY',
+    302: 'FOUND',
+    303: 'SEE OTHER',
+    304: 'NOT MODIFIED',
+    305: 'USE PROXY',
+    306: 'RESERVED',
+    307: 'TEMPORARY REDIRECT',
+    400: 'BAD REQUEST',
+    401: 'UNAUTHORIZED',
+    402: 'PAYMENT REQUIRED',
+    403: 'FORBIDDEN',
     404: 'NOT FOUND',
+    405: 'METHOD NOT ALLOWED',
+    406: 'NOT ACCEPTABLE',
+    407: 'PROXY AUTHENTICATION REQUIRED',
+    408: 'REQUEST TIMEOUT',
+    409: 'CONFLICT',
+    410: 'GONE',
+    411: 'LENGTH REQUIRED',
+    412: 'PRECONDITION FAILED',
+    413: 'REQUEST ENTITY TOO LARGE',
+    414: 'REQUEST-URI TOO LONG',
+    415: 'UNSUPPORTED MEDIA TYPE',
+    416: 'REQUESTED RANGE NOT SATISFIABLE',
+    417: 'EXPECTATION FAILED',
     500: 'INTERNAL SERVER ERROR',
+    501: 'NOT IMPLEMENTED',
+    502: 'BAD GATEWAY',
+    503: 'SERVICE UNAVAILABLE',
+    504: 'GATEWAY TIMEOUT',
+    505: 'HTTP VERSION NOT SUPPORTED',
 }
 
 class WSGIRequest(httpwrappers.HttpRequest):

Attachments (1)

wsgi.patch (1.6 KB) - added by eugene@… 9 years ago.
the same patch as a file

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by eugene@…

the same patch as a file

comment:1 Changed 9 years ago by eugene@…

  • Type changed from defect to enhancement

It's not a defect. It's an enhancement. :D

comment:2 Changed 9 years ago by hugo <gb@…>

  • Summary changed from additional http status codes to [patch] additional http status codes

comment:3 Changed 9 years ago by adrian

  • Status changed from new to assigned

comment:4 Changed 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in [636].

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.