mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-02-01 15:55:28 +00:00
fix pretty_host if no host is present
This commit is contained in:
parent
6852eb9d0a
commit
ab2b98b988
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user