WPD: request path fixes
parent
6d538e2cd3
commit
4cb02189cf
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue