From 4cb02189cfa11c188c07a1bd6e4735ee70466c2a Mon Sep 17 00:00:00 2001 From: justcool393 Date: Mon, 17 Oct 2022 18:12:01 -0500 Subject: [PATCH] WPD: request path fixes --- files/__main__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/__main__.py b/files/__main__.py index 903c09c35..43c70fd25 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -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