From 4ca5726af41ee9bf85912b1e6a56243463e643b9 Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Thu, 28 May 2020 21:10:39 -0400 Subject: [PATCH] Fix an issue with comparing str vs int port numbers --- jetforce/app/base.py | 2 +- jetforce/protocol.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jetforce/app/base.py b/jetforce/app/base.py index 74c2e68..1b25fed 100644 --- a/jetforce/app/base.py +++ b/jetforce/app/base.py @@ -102,7 +102,7 @@ class RoutePattern: server_hostname = request.environ["HOSTNAME"] else: server_hostname = self.hostname - server_port = int(request.environ["SERVER_PORT"]) + server_port = request.environ["SERVER_PORT"] if self.strict_hostname and request.hostname != server_hostname: return diff --git a/jetforce/protocol.py b/jetforce/protocol.py index 7098587..aed5d05 100644 --- a/jetforce/protocol.py +++ b/jetforce/protocol.py @@ -140,7 +140,7 @@ class GeminiProtocol(LineOnlyReceiver): "REMOTE_ADDR": self.client_addr.host, "REMOTE_HOST": self.client_addr.host, "SERVER_NAME": self.server.hostname, - "SERVER_PORT": str(self.client_addr.port), + "SERVER_PORT": self.server.port, "SERVER_PROTOCOL": "GEMINI", "SERVER_SOFTWARE": f"jetforce/{__version__}", "TLS_CIPHER": conn.get_cipher_name(),