forked from MarseyWorld/MarseyWorld
sfdsfd
parent
ff2bd91c48
commit
dc7678e323
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue