fdsfd
This commit is contained in:
parent
755844ecc0
commit
4772ec45be
1 changed files with 12 additions and 1 deletions
|
@ -817,7 +817,18 @@ def user_profile_uid(id):
|
||||||
try: id = int(id, 36)
|
try: id = int(id, 36)
|
||||||
except: abort(404)
|
except: abort(404)
|
||||||
x=get_account(id)
|
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")
|
@app.get("/@<username>/pic")
|
||||||
@limiter.exempt
|
@limiter.exempt
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue