From c27c2a138096e89ac4b8694b954370580c12a87c Mon Sep 17 00:00:00 2001 From: Victor Torres Date: Sun, 29 Sep 2024 22:20:38 -0300 Subject: [PATCH] Refactor --- uvicorn/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uvicorn/config.py b/uvicorn/config.py index 4a1d13d79..4de6abbcf 100644 --- a/uvicorn/config.py +++ b/uvicorn/config.py @@ -332,10 +332,10 @@ def __init__( self.forwarded_allow_ips: list[str] | str if forwarded_allow_ips is None: self.forwarded_allow_ips = os.environ.get("FORWARDED_ALLOW_IPS", "127.0.0.1") - self.forwarded_port = False else: self.forwarded_allow_ips = forwarded_allow_ips # pragma: full coverage - self.forwarded_port = forwarded_port + + self.forwarded_port = forwarded_port if self.reload and self.workers > 1: logger.warning('"workers" flag is ignored when reloading is enabled.')