From e7663138c1e5dc857372eecb2442c64ccac129a9 Mon Sep 17 00:00:00 2001 From: krateng Date: Sat, 26 Mar 2022 06:01:05 +0100 Subject: [PATCH] Fixed redirect loop --- maloja/server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/maloja/server.py b/maloja/server.py index 00865e5..7eaaf03 100644 --- a/maloja/server.py +++ b/maloja/server.py @@ -167,14 +167,15 @@ def dynamic_image(): elif keys['type'] == 'artist': result = resolve_artist_image(keys['id']) - if result is None: return "" + if result is None or result['value'] in [None,'']: + return "" if result['type'] == 'raw': # data uris are directly served as image because a redirect to a data uri # doesnt work duri = datauri.DataURI(result['value']) response.content_type = duri.mimetype return duri.data - else: + if result['type'] == 'url': redirect(result['value'],307) @webserver.route("/images/")