From bf512f5e07ec4392c9582e0a1e3049b2a76573c9 Mon Sep 17 00:00:00 2001 From: Kumi Date: Fri, 27 Sep 2024 07:26:02 +0200 Subject: [PATCH] fix(proxy): specify Forwarded headers in ProxyFix Updated the ProxyFix middleware configuration to explicitly include Forwarded headers for IP address, protocol, host, and port. This enhances reliability of request data handling when the app is behind a reverse proxy, ensuring correct client information is passed to the app. --- src/small/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/small/app.py b/src/small/app.py index 6debce5..a5300e9 100644 --- a/src/small/app.py +++ b/src/small/app.py @@ -20,7 +20,7 @@ def main(): app.debug = True if int(environ.get("PROXY_FIX", 0)): - app.wsgi_app = ProxyFix(app.wsgi_app) + app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_port=1) app.run(port=port)