mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +00:00
fix CONNECT display in upstream mode
This commit is contained in:
parent
c17ccead6d
commit
49d1bcc8a2
@ -334,8 +334,7 @@ class HttpLayer(Layer):
|
|||||||
if self.mode == "regular":
|
if self.mode == "regular":
|
||||||
pass # only absolute-form at this point, nothing to do here.
|
pass # only absolute-form at this point, nothing to do here.
|
||||||
elif self.mode == "upstream":
|
elif self.mode == "upstream":
|
||||||
if flow.request.first_line_format == "authority":
|
pass
|
||||||
flow.request.scheme = "http" # pseudo value
|
|
||||||
else:
|
else:
|
||||||
# Setting request.host also updates the host header, which we want to preserve
|
# Setting request.host also updates the host header, which we want to preserve
|
||||||
host_header = flow.request.headers.get("host", None)
|
host_header = flow.request.headers.get("host", None)
|
||||||
|
@ -178,6 +178,8 @@ class Request(Message):
|
|||||||
"""
|
"""
|
||||||
The URL string, constructed from the request's URL components
|
The URL string, constructed from the request's URL components
|
||||||
"""
|
"""
|
||||||
|
if self.first_line_format == "authority":
|
||||||
|
return "%s:%d" % (self.host, self.port)
|
||||||
return utils.unparse_url(self.scheme, self.host, self.port, self.path)
|
return utils.unparse_url(self.scheme, self.host, self.port, self.path)
|
||||||
|
|
||||||
@url.setter
|
@url.setter
|
||||||
|
Loading…
Reference in New Issue
Block a user