diff options
| author | Yoann L <yoann.lamouroux@data-impact.fr> | 2019-11-04 12:26:21 +0100 | 
|---|---|---|
| committer | Yoann L <yoann.lamouroux@data-impact.fr> | 2019-11-04 12:26:21 +0100 | 
| commit | 1469678b99dcdbd8af5d899f6a8b1036e03ce70f (patch) | |
| tree | 9d15439d880df1572f9ea022d335203363d3e9f6 | |
| parent | ad120c380aeca740d3a9a24b05dc3f181a9557b7 (diff) | |
| download | mitmproxy-1469678b99dcdbd8af5d899f6a8b1036e03ce70f.tar.gz mitmproxy-1469678b99dcdbd8af5d899f6a8b1036e03ce70f.tar.bz2 mitmproxy-1469678b99dcdbd8af5d899f6a8b1036e03ce70f.zip | |
take no action if on `Host` if `:authority` isn't found
| -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 13fbfebb..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.pretty_host) -                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) | 
