Better HTTP code for method not supported

Change HTTP code to raise from 400 to 405 (Method Not Allowed).
This commit is contained in:
Jeremie Dokime
2014-05-12 16:54:18 +02:00
parent 7cfa2a54b7
commit 9892d29bb9
+1 -1
View File
@@ -348,7 +348,7 @@ class Request(Storage):
rest_action = _action().get(method, None)
if not (rest_action and method == method.upper()
and callable(rest_action)):
raise HTTP(400, "method not supported")
raise HTTP(405, "method not allowed")
try:
return rest_action(*_self.args, **getattr(_self, 'vars', {}))
except TypeError, e: