mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
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
This commit is contained in:
parent
eb7ed1dc40
commit
ad120c380a
@ -203,7 +203,7 @@ class ClientPlayback:
|
|||||||
# https://github.com/mitmproxy/mitmproxy/issues/2197
|
# https://github.com/mitmproxy/mitmproxy/issues/2197
|
||||||
if hf.request.http_version == "HTTP/2.0":
|
if hf.request.http_version == "HTTP/2.0":
|
||||||
hf.request.http_version = "HTTP/1.1"
|
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)
|
hf.request.headers.insert(0, "host", host)
|
||||||
self.q.put(hf)
|
self.q.put(hf)
|
||||||
ctx.master.addons.trigger("update", lst)
|
ctx.master.addons.trigger("update", lst)
|
||||||
|
Loading…
Reference in New Issue
Block a user