relaxed REST conditions

This commit is contained in:
mdipierro
2013-09-19 22:18:45 -05:00
parent e7a9457249
commit 2b1f150f02
2 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -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
+2 -3
View File
@@ -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',{}))