mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-29 11:03:13 +00:00
Merge pull request #2858 from kajojify/revert_flow
Fix reverting of a flow
This commit is contained in:
commit
b689f48f7f
@ -164,6 +164,7 @@ class Core:
|
||||
for f in flows:
|
||||
p = getattr(f, part, None)
|
||||
if p:
|
||||
f.backup()
|
||||
p.decode()
|
||||
updated.append(f)
|
||||
ctx.master.addons.trigger("update", updated)
|
||||
@ -178,6 +179,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")
|
||||
@ -204,6 +206,7 @@ class Core:
|
||||
if p:
|
||||
current_enc = p.headers.get("content-encoding", "identity")
|
||||
if current_enc == "identity":
|
||||
f.backup()
|
||||
p.encode(enc)
|
||||
updated.append(f)
|
||||
ctx.master.addons.trigger("update", updated)
|
||||
|
@ -390,6 +390,8 @@ class ConsoleAddon:
|
||||
# but for now it is.
|
||||
if not flow:
|
||||
raise exceptions.CommandError("No flow selected.")
|
||||
flow.backup()
|
||||
|
||||
require_dummy_response = (
|
||||
part in ("response-headers", "response-body", "set-cookies") and
|
||||
flow.response is None
|
||||
|
Loading…
Reference in New Issue
Block a user