This commit is contained in:
Aevann1 2022-01-24 23:41:13 +02:00
parent 75b76ee0b8
commit f58222fcff
2 changed files with 4 additions and 6 deletions

View file

@ -387,8 +387,8 @@ def usersong(username):
@app.get("/song/<song>")
@app.get("/static/song/<song>")
@cache.memoize(timeout=2592000)
def song(song):
if request.path.startswith('/song/'): return redirect(request.full_path.replace('/song/', '/static/song/'))
resp = make_response(send_from_directory('/songs', song))
resp.headers.remove("Cache-Control")
resp.headers.add("Cache-Control", "public, max-age=2628000")