web_config: respect the client's character set for JSON

This commit is contained in:
David Adam 2015-01-30 22:52:38 +08:00
parent 5c16b5598b
commit d17ba69f9e

View file

@ -789,7 +789,7 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
postvars = parse_qs(url_str, keep_blank_values=1)
elif ctype == 'application/json':
length = int(self.headers['content-length'])
url_str = self.rfile.read(length).decode('utf-8')
url_str = self.rfile.read(length).decode(pdict['charset'])
postvars = json.loads(url_str)
else:
postvars = {}