fix pretty_host if no host is present

This commit is contained in:
Maximilian Hils 2015-04-10 19:35:42 +02:00
parent 6852eb9d0a
commit ab2b98b988

View File

@ -631,8 +631,10 @@ class HTTPRequest(HTTPMessage):
host = self.headers.get_first("host") host = self.headers.get_first("host")
if not host: if not host:
host = self.host host = self.host
host = host.encode("idna") if host:
return host return host.encode("idna")
else:
return None
def pretty_url(self, hostheader): def pretty_url(self, hostheader):
if self.form_out == "authority": # upstream proxy mode if self.form_out == "authority": # upstream proxy mode