forked from MarseyWorld/MarseyWorld
fdsfd
parent
1fc1f8dae0
commit
7bc73c8273
|
@ -817,7 +817,18 @@ def user_profile_uid(id):
|
|||
try: id = int(id, 36)
|
||||
except: abort(404)
|
||||
x=get_account(id)
|
||||
return redirect(x.profile_url)
|
||||
|
||||
purl = x.profile_url
|
||||
if not 'images/' in purl: 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
|
||||
|
||||
@app.get("/@<username>/pic")
|
||||
@limiter.exempt
|
||||
|
|
Loading…
Reference in New Issue