From efee8b89e7590ab29ddbfef04c803078f213ae5d Mon Sep 17 00:00:00 2001 From: TLSM Date: Mon, 17 Oct 2022 20:40:09 -0400 Subject: [PATCH] WPD migration: update to reflect env var fix. --- files/__main__.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/files/__main__.py b/files/__main__.py index 9c599cd15..92e1158b1 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -84,10 +84,7 @@ def before_request(): with open('/site_settings.json', 'r', encoding='utf_8') as f: app.config['SETTINGS'] = json.load(f) - #### WPD TEMP #### temporary WPD migration logic (allow watchpeopledie.co on WPD.tv server) - if request.host == 'watchpeopledie.co' and app.config["SERVER_NAME"] == "watchpeopledie.tv": - pass - elif request.host != app.config["SERVER_NAME"]: return {"error": "Unauthorized host provided."}, 403 + 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 if not app.config['SETTINGS']['Bots'] and request.headers.get("Authorization"): abort(403) @@ -97,7 +94,7 @@ def before_request(): g.inferior_browser = 'iphone' in ua or 'ipad' in ua or 'ipod' in ua or 'mac os' in ua or ' firefox/' in ua #### WPD TEMP #### temporary WPD migration logic: redirect to / - if request.host == 'watchpeopledie.co' and app.config["SERVER_NAME"] == "watchpeopledie.tv": + if request.host == 'watchpeopledie.co' and app.config["SERVER_NAME"] == "watchpeopledie.co": request.path = request.path.rstrip('/') if not request.path: request.path = '/' if request.path != '/':