forked from rDrama/rDrama
fix broken images
parent
20585ca543
commit
0b2d0a981d
|
@ -243,10 +243,10 @@ def emoji(emoji):
|
||||||
resp.headers.add("Content-Type", "image/webp")
|
resp.headers.add("Content-Type", "image/webp")
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
@app.get('/i/<image>')
|
@app.get('/i/<path:path>')
|
||||||
@limiter.exempt
|
@limiter.exempt
|
||||||
def image(image):
|
def image(path):
|
||||||
resp = make_response(send_from_directory('assets/images', image))
|
resp = make_response(send_from_directory('assets/images', path))
|
||||||
if request.path.endswith('.webp') or request.path.endswith('.gif') or request.path.endswith('.ttf') or request.path.endswith('.woff2'):
|
if request.path.endswith('.webp') or request.path.endswith('.gif') or request.path.endswith('.ttf') or request.path.endswith('.woff2'):
|
||||||
resp.headers.remove("Cache-Control")
|
resp.headers.remove("Cache-Control")
|
||||||
resp.headers.add("Cache-Control", "public, max-age=3153600")
|
resp.headers.add("Cache-Control", "public, max-age=3153600")
|
||||||
|
|
Loading…
Reference in New Issue