fix /pp/ route (#542)
This commit is contained in:
parent
82e4982261
commit
a5c8741efa
1 changed files with 4 additions and 9 deletions
|
@ -865,16 +865,11 @@ def remove_follow(username, v):
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@app.get("/pp/<id>")
|
@app.get("/pp/<int:id>")
|
||||||
@app.get("/uid/<id>/pic")
|
@app.get("/uid/<int:id>/pic")
|
||||||
@app.get("/uid/<id>/pic/profile")
|
@app.get("/uid/<int:id>/pic/profile")
|
||||||
@limiter.exempt
|
@limiter.exempt
|
||||||
def user_profile_uid(v, id):
|
def user_profile_uid(id:int):
|
||||||
try: id = int(id)
|
|
||||||
except:
|
|
||||||
try: id = int(id, 36)
|
|
||||||
except: abort(404)
|
|
||||||
|
|
||||||
name = f"/pp/{id}"
|
name = f"/pp/{id}"
|
||||||
path = cache.get(name)
|
path = cache.get(name)
|
||||||
tout = 5 * 60 # 5 min
|
tout = 5 * 60 # 5 min
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue