From d62ceb84239ee0df677851f46eb885c40e98211f Mon Sep 17 00:00:00 2001 From: Warren Spits Date: Sat, 23 Apr 2022 03:07:36 +1000 Subject: [PATCH] Add proxyfix to honor `X-Forwarded-Proto` header (#731) Fixes #730 --- app/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/__init__.py b/app/__init__.py index 89a4948..0fdc86f 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -13,9 +13,13 @@ from stem import Signal import threading from dotenv import load_dotenv +from werkzeug.middleware.proxy_fix import ProxyFix + app = Flask(__name__, static_folder=os.path.dirname( os.path.abspath(__file__)) + '/static') +app.wsgi_app = ProxyFix(app.wsgi_app) + # Load .env file if enabled if os.getenv('WHOOGLE_DOTENV', ''): dotenv_path = '../whoogle.env'