aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-04-20 15:27:39 -0700
committerMaximilian Hils <git@maximilianhils.com>2016-04-20 15:27:39 -0700
commit49d1bcc8a237e56d9adef62ea0fce35ae3d4b1e8 (patch)
tree501f0cf151296d43bc3514c19527e7aa8b79f359
parentc17ccead6db98346fa088f7ca035af24694af659 (diff)
downloadmitmproxy-49d1bcc8a237e56d9adef62ea0fce35ae3d4b1e8.tar.gz
mitmproxy-49d1bcc8a237e56d9adef62ea0fce35ae3d4b1e8.tar.bz2
mitmproxy-49d1bcc8a237e56d9adef62ea0fce35ae3d4b1e8.zip
fix CONNECT display in upstream mode
-rw-r--r--mitmproxy/protocol/http.py3
-rw-r--r--netlib/http/request.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/mitmproxy/protocol/http.py b/mitmproxy/protocol/http.py
index 13556e9c..fc181b5d 100644
--- a/mitmproxy/protocol/http.py
+++ b/mitmproxy/protocol/http.py
@@ -334,8 +334,7 @@ class HttpLayer(Layer):
if self.mode == "regular":
pass # only absolute-form at this point, nothing to do here.
elif self.mode == "upstream":
- if flow.request.first_line_format == "authority":
- flow.request.scheme = "http" # pseudo value
+ pass
else:
# Setting request.host also updates the host header, which we want to preserve
host_header = flow.request.headers.get("host", None)
diff --git a/netlib/http/request.py b/netlib/http/request.py
index 160ce3a3..6406a980 100644
--- a/netlib/http/request.py
+++ b/netlib/http/request.py
@@ -178,6 +178,8 @@ class Request(Message):
"""
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)
@url.setter