diff --git a/lib/request/httpshandler.py b/lib/request/httpshandler.py index 4e95c600677..e8239531f8a 100644 --- a/lib/request/httpshandler.py +++ b/lib/request/httpshandler.py @@ -91,7 +91,7 @@ def create_sock(): else: for header, value in conf.httpHeaders: if header.lower() == "host": - hostname = value + hostname = value.split(":")[0] break hostname = hostname if re.search(r"\A[\d.]+\Z", hostname or "") is None else None result = _contexts[protocol].wrap_socket(sock, do_handshake_on_connect=True, server_hostname=hostname)