diff --git a/mitmproxy/flow.py b/mitmproxy/flow.py index 43e21d8a5..3fa0e914b 100644 --- a/mitmproxy/flow.py +++ b/mitmproxy/flow.py @@ -193,11 +193,7 @@ class Flow(stateobject.StateObject): @property def killable(self): """*Read-only:* `True` if this flow can be killed, `False` otherwise.""" - return ( - self.reply and - self.reply.state in {"start", "taken"} and - not (self.error and self.error.msg == Error.KILLED_MESSAGE) - ) + return not (self.error and self.error.msg == Error.KILLED_MESSAGE) def kill(self): """ diff --git a/test/mitmproxy/test_http.py b/test/mitmproxy/test_http.py index 2fa1b2c48..f4bcab989 100644 --- a/test/mitmproxy/test_http.py +++ b/test/mitmproxy/test_http.py @@ -7,7 +7,6 @@ import pytest from mitmproxy import flow from mitmproxy import flowfilter -from mitmproxy.exceptions import ControlException from mitmproxy.http import Headers, Request, Response, HTTPFlow from mitmproxy.net.http.cookies import CookieAttrs from mitmproxy.test.tflow import tflow @@ -704,10 +703,11 @@ class TestHTTPFlow: def test_kill(self): f = tflow() - with pytest.raises(ControlException): - f.intercept() - f.resume() - f.kill() + f.intercept() + f.resume() + assert f.killable + f.kill() + assert not f.killable f = tflow() f.intercept()