From 9892d29bb9a04f28bd54ee1eeea205435efe245d Mon Sep 17 00:00:00 2001 From: Jeremie Dokime Date: Mon, 12 May 2014 16:54:18 +0200 Subject: [PATCH] Better HTTP code for method not supported Change HTTP code to raise from 400 to 405 (Method Not Allowed). --- gluon/globals.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gluon/globals.py b/gluon/globals.py index 2d5f1fef..4bbb72d1 100644 --- a/gluon/globals.py +++ b/gluon/globals.py @@ -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: