summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-11-10 12:32:23 +0200
committerLars Wirzenius <liw@liw.fi>2018-11-10 12:32:23 +0200
commit50de44fa33af2c246e3e7b5805e6fd8c9eeb1142 (patch)
tree97e596a739d9e33cc0bf68f7acf1b11958f2fb94
parent6eb2d9bd81368aa1bbc4c80656db1ea5db419a21 (diff)
downloadmuck-poc-50de44fa33af2c246e3e7b5805e6fd8c9eeb1142.tar.gz
Fix: convert bytes to str (wtf?)
-rwxr-xr-xmuck_poc2
1 files changed, 2 insertions, 0 deletions
diff --git a/muck_poc b/muck_poc
index 4072228..4832a6d 100755
--- a/muck_poc
+++ b/muck_poc
@@ -168,6 +168,8 @@ class MuckAPI:
def _get_json_body(self):
f = bottle.request.body
body = f.read()
+ if isinstance(body, bytes):
+ body = body.decode('UTF-8')
return json.loads(body, encoding='UTF-8')
def _get_resource_id(self):