From 2b1f150f029e96f48df27942672a6a23613f6e4d Mon Sep 17 00:00:00 2001 From: mdipierro Date: Thu, 19 Sep 2013 22:18:45 -0500 Subject: [PATCH] relaxed REST conditions --- VERSION | 2 +- gluon/globals.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index c4c6be39..761c1f37 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.6.3-stable+timestamp.2013.09.19.22.02.47 +Version 2.6.3-stable+timestamp.2013.09.19.22.17.43 diff --git a/gluon/globals.py b/gluon/globals.py index c9f58e1d..2897ff56 100644 --- a/gluon/globals.py +++ b/gluon/globals.py @@ -326,10 +326,9 @@ class Request(Storage): _self.args[-1], _, self.extension = self.args[-1].rpartition('.') current.response.headers['Content-Type'] = \ contenttype('.' + _self.extension.lower()) - if not method in ['GET', 'POST', 'DELETE', 'PUT']: - raise HTTP(400, "invalid method") rest_action = _action().get(method, None) - if not rest_action: + if not (rest_action and method==method.upper() + and callable(rest_action)): raise HTTP(400, "method not supported") try: return rest_action(*_self.args, **getattr(_self,'vars',{}))