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(),