master
Aevann1 2021-12-10 22:40:05 +02:00
parent ff2bd91c48
commit dc7678e323
1 changed files with 1 additions and 12 deletions

View File

@ -817,18 +817,7 @@ def user_profile_uid(id):
try: id = int(id, 36)
except: abort(404)
x=get_account(id)
purl = x.profile_url
if not purl.startswith(f'{request.host_url}images/'): return redirect(purl)
path = purl.split('images/')[1]
resp = make_response(send_from_directory('/images', path))
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
return redirect(x.profile_url)
@app.get("/@<username>/pic")
@limiter.exempt