fixes #2262, body decode on py3, thanks liuyigh
This commit is contained in:
1 parent
6aff6e1132
commit
88ed162dae
1 file changed
+2
-1
+2
-1
@@ -242,7 +242,8 @@ class Request(Storage):
|
|||||||
# parse POST variables on POST, PUT, BOTH only in post_vars
|
# parse POST variables on POST, PUT, BOTH only in post_vars
|
||||||
if body and not is_json and env.request_method in ('POST', 'PUT', 'DELETE', 'BOTH'):
|
if body and not is_json and env.request_method in ('POST', 'PUT', 'DELETE', 'BOTH'):
|
||||||
query_string = env.pop('QUERY_STRING', None)
|
query_string = env.pop('QUERY_STRING', None)
|
||||||
dpost = cgi.FieldStorage(fp=body, environ=env, keep_blank_values=1)
|
decoded_body = body if global_settings.is_py2 else body.decode()
|
||||||
|
dpost = cgi.FieldStorage(fp=decoded_body, environ=env, keep_blank_values=1)
|
||||||
try:
|
try:
|
||||||
post_vars.update(dpost)
|
post_vars.update(dpost)
|
||||||
except:
|
except:
|
||||||
|
|||||||
Reference in new issue
Block a user