Skip proxyauth on client replay, fix #6836 (#6866)

* skip proxyauth on client replay, fix #6836

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Maximilian Hils 2024-05-22 02:31:48 +02:00 committed by GitHub
parent ae56c9e488
commit 215dfea515
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 0 deletions

View File

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

View File

@ -76,6 +76,8 @@ class ProxyAuth:
# 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)

View File

@ -239,6 +239,11 @@ class TestProxyAuth:
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",