1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Fixed redirect loop

This commit is contained in:
krateng 2022-03-26 06:01:05 +01:00
parent 66bd69b49e
commit e7663138c1

View File

@ -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/<pth:re:.*\\.jpeg>")