fixed Issue 1563:Web2py in error when the request contains a json string corresponding to a list, thanks Hono Sandai

This commit is contained in:
mdipierro
2013-06-27 01:51:03 -05:00
parent 92757a4e2b
commit 768b49224c
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.6.0-development+timestamp.2013.06.26.05.11.38
Version 2.6.0-development+timestamp.2013.06.27.01.50.11
+4 -3
View File
@@ -339,8 +339,9 @@ def parse_get_post_vars(request, environ):
json_vars = {}
pass
# update vars and get_vars with what was posted as json
request.get_vars.update(json_vars)
request.vars.update(json_vars)
if isinstance(json_vars,dict):
request.get_vars.update(json_vars)
request.vars.update(json_vars)
# parse POST variables on POST, PUT, BOTH only in post_vars
@@ -386,7 +387,7 @@ def parse_get_post_vars(request, environ):
if len(pvalue):
request.post_vars[key] = (len(pvalue) >
1 and pvalue) or pvalue[0]
if is_json:
if is_json and isinstance(json_vars,dict):
# update post_vars with what was posted as json
request.post_vars.update(json_vars)