mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +00:00
f5dc0aace1
- Exposes view.add as a command - Copes with cases where a view addon isn't present - Avoids infinite loop caused by replaying replays Fixes #3096
15 lines
466 B
Python
15 lines
466 B
Python
from mitmproxy import ctx
|
|
|
|
|
|
def request(flow):
|
|
# Avoid an infinite loop by not replaying already replayed requests
|
|
if flow.request.is_replay:
|
|
return
|
|
flow = flow.copy()
|
|
# Only interactive tools have a view. If we have one, add a duplicate entry
|
|
# for our flow.
|
|
if "view" in ctx.master.addons:
|
|
ctx.master.commands.call("view.add", [flow])
|
|
flow.request.path = "/changed"
|
|
ctx.master.commands.call("replay.client", [flow])
|