freedom
This commit is contained in:
parent
080a9e6455
commit
a715c29e75
5775 changed files with 0 additions and 1163525 deletions
|
@ -333,19 +333,6 @@ def archives(v, path):
|
|||
if request.path.endswith('.css'): resp.headers.add("Content-Type", "text/css")
|
||||
return resp
|
||||
|
||||
@app.get('/static/<path:path>')
|
||||
@limiter.exempt
|
||||
def static_service2(path):
|
||||
resp = make_response(send_from_directory('./static', path))
|
||||
if request.path.endswith('.webp') or request.path.endswith('.gif') or request.path.endswith('.ttf') or request.path.endswith('.woff') or request.path.endswith('.woff2'):
|
||||
resp.headers.remove("Cache-Control")
|
||||
resp.headers.add("Cache-Control", "public, max-age=2628000")
|
||||
|
||||
if request.path.endswith('.webp'):
|
||||
resp.headers.remove("Content-Type")
|
||||
resp.headers.add("Content-Type", "image/webp")
|
||||
return resp
|
||||
|
||||
@app.get('/assets/<path:path>')
|
||||
@app.get('/static/assets/<path:path>')
|
||||
@limiter.exempt
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue