fix /pp/ route (#542)

This commit is contained in:
justcool393 2023-03-14 11:33:48 -07:00 committed by GitHub
parent 82e4982261
commit a5c8741efa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -865,16 +865,11 @@ def remove_follow(username, v):
from urllib.parse import urlparse
import re
@app.get("/pp/<id>")
@app.get("/uid/<id>/pic")
@app.get("/uid/<id>/pic/profile")
@app.get("/pp/<int:id>")
@app.get("/uid/<int:id>/pic")
@app.get("/uid/<int:id>/pic/profile")
@limiter.exempt
def user_profile_uid(v, id):
try: id = int(id)
except:
try: id = int(id, 36)
except: abort(404)
def user_profile_uid(id:int):
name = f"/pp/{id}"
path = cache.get(name)
tout = 5 * 60 # 5 min