diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2015-07-21 14:44:11 +0200 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2015-07-21 14:47:18 +0200 |
commit | 92289b32248f4568579edfd5a301e571ade0c284 (patch) | |
tree | 2eced0067f8b947c10633c71d09699879ccd68f7 /pyaggr3g470r/views | |
parent | adding a no change return policy (diff) | |
download | newspipe-92289b32248f4568579edfd5a301e571ade0c284.tar.gz newspipe-92289b32248f4568579edfd5a301e571ade0c284.tar.bz2 newspipe-92289b32248f4568579edfd5a301e571ade0c284.zip |
fetching mimetypes with images
Diffstat (limited to 'pyaggr3g470r/views')
-rw-r--r-- | pyaggr3g470r/views/feed.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pyaggr3g470r/views/feed.py b/pyaggr3g470r/views/feed.py index 99986fe7..1a3ad938 100644 --- a/pyaggr3g470r/views/feed.py +++ b/pyaggr3g470r/views/feed.py @@ -207,4 +207,9 @@ def icon(feed_id): headers = {'Cache-Control': 'max-age=86400', 'etag': etag} if request.headers.get('if-none-match') == etag: return Response(status=304, headers=headers) - return Response(base64.b64decode(icon), mimetype='image', headers=headers) + if '\n' in icon: + content_type, icon = icon.split() + headers['content-type'] = content_type + else: + headers['content-type'] = 'application/image' + return Response(base64.b64decode(icon), headers=headers) |