Add deepcopy to allow view.flows.resolve (issue #4916) (#4952)

* Add deepcopy to allow view.flows.resolve (issue #4916)

* try to simplify deepcopy implementation

* remove leftover check

Co-authored-by: Maximilian Hils <github@maximilianhils.com>
This commit is contained in:
Brad Dixon 2021-11-26 17:14:06 -05:00 committed by GitHub
parent b1c1cd3f2f
commit b1d0887db4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -18,6 +18,7 @@
* Upstream replays don't do CONNECT on plaintext HTTP requests (#4876, @HoffmannP) * Upstream replays don't do CONNECT on plaintext HTTP requests (#4876, @HoffmannP)
* Remove workarounds for old pyOpenSSL versions (#4831, @KarlParkinson) * Remove workarounds for old pyOpenSSL versions (#4831, @KarlParkinson)
* Add fonts to asset filter (~a) (#4928, @elespike) * Add fonts to asset filter (~a) (#4928, @elespike)
* Fix bug that crashed when using `view.flows.resolve` (#4916, @rbdixon)
## 28 September 2021: mitmproxy 7.0.4 ## 28 September 2021: mitmproxy 7.0.4

View File

@ -65,6 +65,10 @@ class Reply:
# This will be ignored by the interpreter, but emit a warning # This will be ignored by the interpreter, but emit a warning
raise exceptions.ControlException(f"Uncommitted reply: {self.obj}") raise exceptions.ControlException(f"Uncommitted reply: {self.obj}")
def __deepcopy__(self, memo):
# some parts of the console ui may use deepcopy, see https://github.com/mitmproxy/mitmproxy/issues/4916
return memo.setdefault(id(self), DummyReply())
class DummyReply(Reply): class DummyReply(Reply):
""" """