WPD: request path fixes

remotes/1693176582716663532/tmp_refs/heads/watchparty
justcool393 2022-10-17 18:12:01 -05:00
parent 6d538e2cd3
commit 4cb02189cf
1 changed files with 3 additions and 1 deletions

View File

@ -87,7 +87,9 @@ def before_request():
if request.host == 'watchpeopledie.co' and app.config["SERVER_NAME"] == "watchpeopledie.tv":
#### WPD TEMP #### temporary WPD migration logic: redirect to /
if request.host != '/':
request.path = request.path.rstrip('/')
if not request.path: request.path = '/'
if request.path != '/':
return redirect('/')
if request.host != app.config["SERVER_NAME"]: return {"error": "Unauthorized host provided."}, 403
if request.headers.get("CF-Worker"): return {"error": "Cloudflare workers are not allowed to access this website."}, 403