Skip to content

Commit

Permalink
Skip proxyauth on client replay, fix #6836 (#6866)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
mhils and autofix-ci[bot] committed May 22, 2024
1 parent ae56c9e commit 215dfea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions mitmproxy/addons/proxyauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 5 additions & 0 deletions test/mitmproxy/addons/test_proxyauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 215dfea

Please sign in to comment.