Kill this flow. The current request/response will not be forwarded to its destination.
(self)
| 228 | return self.live and not (self.error and self.error.msg == Error.KILLED_MESSAGE) |
| 229 | |
| 230 | def kill(self): |
| 231 | """ |
| 232 | Kill this flow. The current request/response will not be forwarded to its destination. |
| 233 | """ |
| 234 | if not self.killable: |
| 235 | raise exceptions.ControlException("Flow is not killable.") |
| 236 | # TODO: The way we currently signal killing is not ideal. One major problem is that we cannot kill |
| 237 | # flows in transit (https://github.com/mitmproxy/mitmproxy/issues/4711), even though they are advertised |
| 238 | # as killable. An alternative approach would be to introduce a `KillInjected` event similar to |
| 239 | # `MessageInjected`, which should fix this issue. |
| 240 | self.error = Error(Error.KILLED_MESSAGE) |
| 241 | self.intercepted = False |
| 242 | self.live = False |
| 243 | |
| 244 | def intercept(self): |
| 245 | """ |