Update request.py

self.body decoded by 'latin1' seems more resonable.
This commit is contained in:
veelion 2018-07-30 10:34:43 +08:00 committed by GitHub
parent 6f4b1fbd0d
commit 2b0b2c796f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -127,7 +127,7 @@ class Request(dict):
try: try:
if content_type == 'application/x-www-form-urlencoded': if content_type == 'application/x-www-form-urlencoded':
self.parsed_form = RequestParameters( self.parsed_form = RequestParameters(
parse_qs(self.body.decode('utf-8'), encoding='latin1')) parse_qs(self.body.decode('latin1'), encoding='latin1'))
elif content_type == 'multipart/form-data': elif content_type == 'multipart/form-data':
# TODO: Stream this instead of reading to/from memory # TODO: Stream this instead of reading to/from memory
boundary = parameters['boundary'].encode('utf-8') boundary = parameters['boundary'].encode('utf-8')