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:
|
for f in flows:
|
||||||
p = getattr(f, part, None)
|
p = getattr(f, part, None)
|
||||||
if p:
|
if p:
|
||||||
|
f.backup()
|
||||||
p.decode()
|
p.decode()
|
||||||
updated.append(f)
|
updated.append(f)
|
||||||
ctx.master.addons.trigger("update", updated)
|
ctx.master.addons.trigger("update", updated)
|
||||||
@ -178,6 +179,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")
|
||||||
@ -204,6 +206,7 @@ class Core:
|
|||||||
if p:
|
if p:
|
||||||
current_enc = p.headers.get("content-encoding", "identity")
|
current_enc = p.headers.get("content-encoding", "identity")
|
||||||
if current_enc == "identity":
|
if current_enc == "identity":
|
||||||
|
f.backup()
|
||||||
p.encode(enc)
|
p.encode(enc)
|
||||||
updated.append(f)
|
updated.append(f)
|
||||||
ctx.master.addons.trigger("update", updated)
|
ctx.master.addons.trigger("update", updated)
|
||||||
|
@ -390,6 +390,8 @@ class ConsoleAddon:
|
|||||||
# but for now it is.
|
# but for now it is.
|
||||||
if not flow:
|
if not flow:
|
||||||
raise exceptions.CommandError("No flow selected.")
|
raise exceptions.CommandError("No flow selected.")
|
||||||
|
flow.backup()
|
||||||
|
|
||||||
require_dummy_response = (
|
require_dummy_response = (
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user