diff options
author | Maximilian Hils <git@maximilianhils.com> | 2019-11-04 13:20:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-04 13:20:21 +0100 |
commit | 37994fb12f8e5441cc5dc53bcfe1442060248925 (patch) | |
tree | f31bc8367dcdb1e8dd8057f8176d1de417acadab | |
parent | 65edbda137b5c5946314d38cb78b035deed8ac05 (diff) | |
parent | 1469678b99dcdbd8af5d899f6a8b1036e03ce70f (diff) | |
download | mitmproxy-37994fb12f8e5441cc5dc53bcfe1442060248925.tar.gz mitmproxy-37994fb12f8e5441cc5dc53bcfe1442060248925.tar.bz2 mitmproxy-37994fb12f8e5441cc5dc53bcfe1442060248925.zip |
Merge pull request #3675 from ylmrx/crash_on_replay-3559
fixes #3559
-rw-r--r-- | mitmproxy/addons/clientplayback.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mitmproxy/addons/clientplayback.py b/mitmproxy/addons/clientplayback.py index c56c0e74..7bdaeb33 100644 --- a/mitmproxy/addons/clientplayback.py +++ b/mitmproxy/addons/clientplayback.py @@ -203,8 +203,9 @@ 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") - hf.request.headers.insert(0, "host", host) + host = hf.request.headers.pop(":authority", None) + if host is not None: + hf.request.headers.insert(0, "host", host) self.q.put(hf) ctx.master.addons.trigger("update", lst) |