Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#1646 closed enhancement (fixed)

[patch] HttpResponseNotAllowed to return '405's

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


from RFC 2616: An origin server SHOULD return the status code 405 (Method Not Allowed) if the method is known by the origin server but not allowed for the requested resource.

Index: /magik/django/http/
--- /magik/django/http/      (revision 2704)
+++ /magik/django/http/      (working copy)
@@ -265,6 +265,11 @@
         HttpResponse.__init__(self, *args, **kwargs)
         self.status_code = 403
+class HttpResponseNotAllowed(HttpResponse):
+    def __init__(self, *args, **kwargs):
+        HttpResponse.__init__(self, *args, **kwargs)
+        self.status_code = 405
 class HttpResponseGone(HttpResponse):
     def __init__(self, *args, **kwargs):
         HttpResponse.__init__(self, *args, **kwargs)

Change History (2)

comment:1 Changed 13 years ago by Malcolm Tredinnick

Owner: changed from Adrian Holovaty to Malcolm Tredinnick

This is a pre-requisite to fixing #2185.

comment:2 Changed 13 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [3144]) Fixed #1646 -- Added HttpResponseNotAllowed, as suggested by Ian Holsman.

Note: See TracTickets for help on using tickets.
Back to Top