This commit is contained in:
Aevann1 2022-04-02 21:42:21 +02:00
parent 0ef9448211
commit 1832300dfd
6 changed files with 3 additions and 41 deletions

View file

@ -114,18 +114,10 @@ def submit_get(v, sub=None):
@app.get("/post/<pid>")
@app.get("/post/<pid>/<anything>")
@app.get("/logged_out/post/<pid>")
@app.get("/logged_out/post/<pid>/<anything>")
@app.get("/h/<sub>/post/<pid>")
@app.get("/h/<sub>/post/<pid>/<anything>")
@app.get("/logged_out/h/<sub>/post/<pid>")
@app.get("/logged_out/h/<sub>/post/<pid>/<anything>")
@auth_desired
def post_id(pid, anything=None, v=None, sub=None):
if not v and not request.path.startswith('/logged_out') and not request.headers.get("Authorization"):
return redirect(f"/logged_out{request.full_path}")
if v and request.path.startswith('/logged_out'): v = None
try: pid = int(pid)
except Exception as e: pass