From e09d2d258e992a08df0f96efbf296ad05f798e9b Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Tue, 17 Aug 2021 11:32:45 +0200 Subject: Add ProxyFix middleware This is needed for the proper request URLs to be detected during login. --- fbin/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fbin') diff --git a/fbin/__init__.py b/fbin/__init__.py index f36d74b..7bcdf0b 100644 --- a/fbin/__init__.py +++ b/fbin/__init__.py @@ -1,13 +1,14 @@ from flask import Flask, url_for, Markup, request from flask_login import current_user from werkzeug.routing import BaseConverter +from werkzeug.middleware.proxy_fix import ProxyFix app = Flask(__name__) app.config.from_pyfile('fbin.cfg') - -# Set up some custom converters. These are needed for file URLs to be properly parsed. +app.wsgi_app = ProxyFix(app.wsgi_app) +# Set up some custom converters. These are needed for file URLs to be properly parsed. class HashConverter(BaseConverter): regex = r'\w+' -- cgit v1.2.3