diff --git a/lib/request/connect.py b/lib/request/connect.py index d7b941a7d..7c245eb55 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -225,7 +225,7 @@ class Connect: headers[HTTPHEADER.HOST] = urlparse.urlparse(url).netloc - if headers[HTTPHEADER.HOST].endswith(':80'): + if any(map(lambda x: headers[HTTPHEADER.HOST].endswith(':%d' % x), [80, 443])): headers[HTTPHEADER.HOST] = headers[HTTPHEADER.HOST].split(':')[0] if auxHeaders: