mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +00:00
Fix reverting of a flow
This commit is contained in:
parent
a71d050fbf
commit
8eec21d553
@ -178,6 +178,7 @@ class Core:
|
|||||||
for f in flows:
|
for f in flows:
|
||||||
p = getattr(f, part, None)
|
p = getattr(f, part, None)
|
||||||
if p:
|
if p:
|
||||||
|
f.backup()
|
||||||
current_enc = p.headers.get("content-encoding", "identity")
|
current_enc = p.headers.get("content-encoding", "identity")
|
||||||
if current_enc == "identity":
|
if current_enc == "identity":
|
||||||
p.encode("deflate")
|
p.encode("deflate")
|
||||||
|
@ -383,6 +383,7 @@ class ConsoleAddon:
|
|||||||
part in ("response-headers", "response-body", "set-cookies") and
|
part in ("response-headers", "response-body", "set-cookies") and
|
||||||
flow.response is None
|
flow.response is None
|
||||||
)
|
)
|
||||||
|
flow.backup()
|
||||||
if require_dummy_response:
|
if require_dummy_response:
|
||||||
flow.response = http.HTTPResponse.make()
|
flow.response = http.HTTPResponse.make()
|
||||||
if part == "cookies":
|
if part == "cookies":
|
||||||
|
Loading…
Reference in New Issue
Block a user