I have a script and want to return a saved response if ‘xyz’ in flow.request.url. Is there a way to access the saved flows? Is there a way to do something like this? -
for flow in mitmproxy.ctx.saved_flows
if flow.url === 'xyz'
return flow
Thanks for the reply. The answer you suggested seems to work nicely. However, I cannot seem to make updates to the response content stick. Any thoughts?
def response(flow):
flow.response.set_content(replaced_content) # does not persist on playback