This commit is contained in:
Aevann1 2021-10-07 10:43:35 +02:00
parent 6151ae1580
commit cc966888e6
5 changed files with 11 additions and 10 deletions

View file

@ -231,12 +231,10 @@ def submit_contact(v):
return render_template("contact.html", v=v, msg="Your message has been sent.")
@app.get('/archives')
@limiter.exempt
def archivesindex():
return redirect("/archives/index.html")
@app.get('/archives/<path:path>')
@limiter.exempt
def archives(path):
resp = make_response(send_from_directory('/archives', path))
if request.path.endswith('.css'): resp.headers.add("Content-Type", "text/css")
@ -252,10 +250,11 @@ def static_service(path):
return resp
@app.get('/images/<path:path>')
@app.get('/hostedimages/<path:path>')
@limiter.exempt
def images(path):
resp = make_response(send_from_directory('/hostedimages', path))
resp = make_response(send_from_directory('/images', path))
resp.headers.remove("Cache-Control")
resp.headers.add("Cache-Control", "public, max-age=2628000")
return resp