Merge pull request #440 from dokime7/patch-2
Better HTTP code for method not supported
This commit is contained in:
+1
-1
@@ -348,7 +348,7 @@ class Request(Storage):
|
|||||||
rest_action = _action().get(method, None)
|
rest_action = _action().get(method, None)
|
||||||
if not (rest_action and method == method.upper()
|
if not (rest_action and method == method.upper()
|
||||||
and callable(rest_action)):
|
and callable(rest_action)):
|
||||||
raise HTTP(400, "method not supported")
|
raise HTTP(405, "method not allowed")
|
||||||
try:
|
try:
|
||||||
return rest_action(*_self.args, **getattr(_self, 'vars', {}))
|
return rest_action(*_self.args, **getattr(_self, 'vars', {}))
|
||||||
except TypeError, e:
|
except TypeError, e:
|
||||||
|
|||||||
Reference in New Issue
Block a user