mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Hopefully fixed image proxying
This commit is contained in:
parent
57142bc327
commit
02e3f17594
@ -320,7 +320,7 @@ def track_info(dbconn=None,**keys):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def issues():
|
def issues(dbconn=None):
|
||||||
return ISSUES
|
return ISSUES
|
||||||
|
|
||||||
def check_issues():
|
def check_issues():
|
||||||
@ -413,7 +413,7 @@ def check_issues():
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def get_predefined_rulesets():
|
def get_predefined_rulesets(dbconn=None):
|
||||||
validchars = "-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
validchars = "-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
||||||
|
|
||||||
rulesets = []
|
rulesets = []
|
||||||
|
@ -5,6 +5,7 @@ from threading import Thread
|
|||||||
import setproctitle
|
import setproctitle
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
from css_html_js_minify import html_minify, css_minify
|
from css_html_js_minify import html_minify, css_minify
|
||||||
|
import datauri
|
||||||
|
|
||||||
|
|
||||||
# server stuff
|
# server stuff
|
||||||
@ -165,6 +166,13 @@ def dynamic_image():
|
|||||||
result = get_artist_image(relevant['artist'])
|
result = get_artist_image(relevant['artist'])
|
||||||
|
|
||||||
if result is None: return ""
|
if result is None: return ""
|
||||||
|
if result.startswith("data:"):
|
||||||
|
# data uris are directly served as image because a redirect to a data uri
|
||||||
|
# doesnt work
|
||||||
|
duri = datauri.DataURI(result)
|
||||||
|
response.content_type = duri.mimetype
|
||||||
|
return duri.data
|
||||||
|
else:
|
||||||
redirect(result,307)
|
redirect(result,307)
|
||||||
|
|
||||||
@webserver.route("/images/<pth:re:.*\\.jpeg>")
|
@webserver.route("/images/<pth:re:.*\\.jpeg>")
|
||||||
|
Loading…
Reference in New Issue
Block a user