host may be None, account for that

This commit is contained in:
Chris Meyers 2017-02-23 14:31:24 -05:00
parent fe3d79b5ec
commit 2f604f30d9

View File

@ -88,7 +88,7 @@ class BaseHTTPSHandler(logging.Handler):
self.session.headers.update(headers)
def get_http_host(self):
host = self.host
host = self.host or ''
if not host.startswith('http'):
host = 'http://%s' % self.host
if self.port != 80 and self.port is not None: