Fix an issue with comparing str vs int port numbers

This commit is contained in:
Michael Lazar 2020-05-28 21:10:39 -04:00
parent 226efea6b0
commit 4ca5726af4
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

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