]> git.aero2k.de Git - sirius.git/commitdiff
Fix image POSTs over Print Keys
authorJoe Rickerby <joerick@mac.com>
Fri, 12 Jan 2018 14:09:29 +0000 (14:09 +0000)
committerJoe Rickerby <joerick@mac.com>
Fri, 12 Jan 2018 14:09:29 +0000 (14:09 +0000)
sirius/web/print_key_api.py

index 9b2895eafa11afbb9ffbcd67cc6803477bfc0c34..8373d63b615068e474cdcebdef2b2697748c27df 100644 (file)
@@ -57,7 +57,7 @@ def print_key(print_key_secret):
         if request.content_type == 'text/html':
             html = request.get_data(as_text=True)
         elif request.content_type.startswith('image/'):
-            html = html_for_image_data(request.data)
+            html = html_for_image_data(request.get_data())
         elif request.content_type.startswith('text/'):
             # fallback for sending any text format
             html = html_for_plain_text(request.get_data(as_text=True))
@@ -89,4 +89,5 @@ def html_for_image_data(image_data):
         type=request.content_type,
         data=base64.b64encode(image_data)
     )
-    return '<img src="{uri}" style="width: 100%">'
\ No newline at end of file
+
+    return '<img src="{uri}" style="width: 100%">'.format(uri=data_uri)
\ No newline at end of file