Fix another python 3 and unicode issue
This commit is contained in:
parent
cd4a7492cd
commit
fa9c0576ba
@ -17,6 +17,7 @@
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
import six
|
||||||
from werkzeug.http import parse_options_header
|
from werkzeug.http import parse_options_header
|
||||||
|
|
||||||
from mediagoblin.db.models import User, AccessToken
|
from mediagoblin.db.models import User, AccessToken
|
||||||
@ -65,7 +66,7 @@ def decode_request(request):
|
|||||||
content_type, _ = parse_options_header(request.content_type)
|
content_type, _ = parse_options_header(request.content_type)
|
||||||
|
|
||||||
if content_type == json_encoded:
|
if content_type == json_encoded:
|
||||||
data = json.loads(data)
|
data = json.loads(six.text_type(data, "utf-8"))
|
||||||
elif content_type == form_encoded or content_type == "":
|
elif content_type == form_encoded or content_type == "":
|
||||||
data = request.form
|
data = request.form
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user