diff --git a/CHANGELOG.md b/CHANGELOG.md index 830fc1d7da..4f662f2deb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ ([#6819](https://github.com/mitmproxy/mitmproxy/pull/6819), @mhils) * Set the `unbuffered` (stdout/stderr) flag for the `mitmdump` PyInstaller build. ([#6821](https://github.com/mitmproxy/mitmproxy/pull/6821), @Prinzhorn) +* Fix a bug where client replay would not work with proxyauth. + ([#6866](https://github.com/mitmproxy/mitmproxy/pull/6866), @mhils) ## 17 April 2024: mitmproxy 10.3.0 diff --git a/mitmproxy/addons/proxyauth.py b/mitmproxy/addons/proxyauth.py index 13e1ef02e2..9250251da3 100644 --- a/mitmproxy/addons/proxyauth.py +++ b/mitmproxy/addons/proxyauth.py @@ -76,6 +76,8 @@ def requestheaders(self, f: http.HTTPFlow) -> None: # Is this connection authenticated by a previous HTTP CONNECT? if f.client_conn in self.authenticated: f.metadata["proxyauth"] = self.authenticated[f.client_conn] + elif f.is_replay: + pass else: self.authenticate_http(f) diff --git a/test/mitmproxy/addons/test_proxyauth.py b/test/mitmproxy/addons/test_proxyauth.py index 743bc635bf..e715e9d11d 100644 --- a/test/mitmproxy/addons/test_proxyauth.py +++ b/test/mitmproxy/addons/test_proxyauth.py @@ -239,6 +239,11 @@ def test_handlers(self): assert not f2.response assert f2.metadata["proxyauth"] == ("test", "test") + f3 = tflow.tflow() + f3.is_replay = True + up.requestheaders(f3) + assert not f2.response + @pytest.mark.parametrize( "spec",