diff options
author | Miroslav <ttahabatt@gmail.com> | 2018-02-10 20:29:38 +0200 |
---|---|---|
committer | Miroslav <ttahabatt@gmail.com> | 2018-02-10 20:29:38 +0200 |
commit | 8eec21d553420c51635701c4b57e2df4ddc41890 (patch) | |
tree | e0995b45472672daeacdb97771182f51f5e168ef | |
parent | a71d050fbfebbfa801d069cd15279ae9a25de676 (diff) | |
download | mitmproxy-8eec21d553420c51635701c4b57e2df4ddc41890.tar.gz mitmproxy-8eec21d553420c51635701c4b57e2df4ddc41890.tar.bz2 mitmproxy-8eec21d553420c51635701c4b57e2df4ddc41890.zip |
Fix reverting of a flow
-rw-r--r-- | mitmproxy/addons/core.py | 1 | ||||
-rw-r--r-- | mitmproxy/tools/console/consoleaddons.py | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/mitmproxy/addons/core.py b/mitmproxy/addons/core.py index 2b0b2f14..fb46f243 100644 --- a/mitmproxy/addons/core.py +++ b/mitmproxy/addons/core.py @@ -178,6 +178,7 @@ class Core: for f in flows: p = getattr(f, part, None) if p: + f.backup() current_enc = p.headers.get("content-encoding", "identity") if current_enc == "identity": p.encode("deflate") diff --git a/mitmproxy/tools/console/consoleaddons.py b/mitmproxy/tools/console/consoleaddons.py index 5907fe95..deaf016d 100644 --- a/mitmproxy/tools/console/consoleaddons.py +++ b/mitmproxy/tools/console/consoleaddons.py @@ -383,6 +383,7 @@ class ConsoleAddon: part in ("response-headers", "response-body", "set-cookies") and flow.response is None ) + flow.backup() if require_dummy_response: flow.response = http.HTTPResponse.make() if part == "cookies": |