aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy
diff options
context:
space:
mode:
authorYoann L <yoann.lamouroux@data-impact.fr>2019-10-25 10:38:35 +0200
committerYoann L <yoann.lamouroux@data-impact.fr>2019-10-25 10:38:35 +0200
commitad120c380aeca740d3a9a24b05dc3f181a9557b7 (patch)
treee4bc94dd6e22c3f317736ad71b4ed6f074c78a16 /mitmproxy
parenteb7ed1dc40025dd9eada5b01852fc20106a4a204 (diff)
downloadmitmproxy-ad120c380aeca740d3a9a24b05dc3f181a9557b7.tar.gz
mitmproxy-ad120c380aeca740d3a9a24b05dc3f181a9557b7.tar.bz2
mitmproxy-ad120c380aeca740d3a9a24b05dc3f181a9557b7.zip
fixes #3559
if the `:authority` header is not found, we can try to guess it from variable `flow.request.pretty_host` as .pop() accepts a fallback parameter
Diffstat (limited to 'mitmproxy')
-rw-r--r--mitmproxy/addons/clientplayback.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mitmproxy/addons/clientplayback.py b/mitmproxy/addons/clientplayback.py
index c56c0e74..13fbfebb 100644
--- a/mitmproxy/addons/clientplayback.py
+++ b/mitmproxy/addons/clientplayback.py
@@ -203,7 +203,7 @@ class ClientPlayback:
# https://github.com/mitmproxy/mitmproxy/issues/2197
if hf.request.http_version == "HTTP/2.0":
hf.request.http_version = "HTTP/1.1"
- host = hf.request.headers.pop(":authority")
+ host = hf.request.headers.pop(":authority", hf.request.pretty_host)
hf.request.headers.insert(0, "host", host)
self.q.put(hf)
ctx.master.addons.trigger("update", lst)