Merge pull request #440 from dokime7/patch-2

Better HTTP code for method not supported
This commit is contained in:
mdipierro
2014-05-16 22:19:49 -05:00
+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: