Merge pull request #3675 from ylmrx/crash_on_replay-3559

fixes #3559
This commit is contained in:
Maximilian Hils 2019-11-04 13:20:21 +01:00 committed by GitHub
commit 37994fb12f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -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)