mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
Make scripted rewriting of saved traffic work in mitmdump.
This commit is contained in:
parent
be133e7a0b
commit
ce48cb4deb
@ -85,15 +85,6 @@ class DumpMaster(flow.FlowMaster):
|
||||
not options.keepserving
|
||||
)
|
||||
|
||||
if options.rfile:
|
||||
path = os.path.expanduser(options.rfile)
|
||||
try:
|
||||
f = file(path, "r")
|
||||
freader = flow.FlowReader(f)
|
||||
except IOError, v:
|
||||
raise DumpError(v.strerror)
|
||||
self.load_flows(freader)
|
||||
|
||||
if options.client_replay:
|
||||
self.start_client_playback(
|
||||
self._readflow(options.client_replay),
|
||||
@ -105,6 +96,16 @@ class DumpMaster(flow.FlowMaster):
|
||||
if err:
|
||||
raise DumpError(err)
|
||||
|
||||
if options.rfile:
|
||||
path = os.path.expanduser(options.rfile)
|
||||
try:
|
||||
f = file(path, "r")
|
||||
freader = flow.FlowReader(f)
|
||||
except IOError, v:
|
||||
raise DumpError(v.strerror)
|
||||
self.load_flows(freader)
|
||||
|
||||
|
||||
def _readflow(self, path):
|
||||
path = os.path.expanduser(path)
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user