removed double json.loads(body), thanks Simone
This commit is contained in:
+1
-6
@@ -375,12 +375,7 @@ class Request(Storage):
|
|||||||
and callable(rest_action)):
|
and callable(rest_action)):
|
||||||
raise HTTP(405, "method not allowed")
|
raise HTTP(405, "method not allowed")
|
||||||
try:
|
try:
|
||||||
vars = request.vars
|
res = rest_action(*request.args, **request.vars)
|
||||||
if method == 'POST' and is_json:
|
|
||||||
body = request.body.read()
|
|
||||||
if len(body):
|
|
||||||
vars = sj.loads(body)
|
|
||||||
res = rest_action(*request.args, **vars)
|
|
||||||
if is_json and not isinstance(res, str):
|
if is_json and not isinstance(res, str):
|
||||||
res = json(res)
|
res = json(res)
|
||||||
return res
|
return res
|
||||||
|
|||||||
Reference in New Issue
Block a user