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")
|
||||
if not host:
|
||||
host = self.host
|
||||
host = host.encode("idna")
|
||||
return host
|
||||
if host:
|
||||
return host.encode("idna")
|
||||
else:
|
||||
return None
|
||||
|
||||
def pretty_url(self, hostheader):
|
||||
if self.form_out == "authority": # upstream proxy mode
|
||||
|
Loading…
Reference in New Issue
Block a user