mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-02-01 07:49:10 +00:00
fix #1089
This commit is contained in:
parent
613a05b5b7
commit
c7a85d1b9e
@ -91,7 +91,8 @@ class DumpMaster(flow.FlowMaster):
|
|||||||
if options.outfile:
|
if options.outfile:
|
||||||
err = self.start_stream_to_path(
|
err = self.start_stream_to_path(
|
||||||
options.outfile[0],
|
options.outfile[0],
|
||||||
options.outfile[1]
|
options.outfile[1],
|
||||||
|
self.filt
|
||||||
)
|
)
|
||||||
if err:
|
if err:
|
||||||
raise DumpError(err)
|
raise DumpError(err)
|
||||||
|
@ -1098,11 +1098,11 @@ class FlowMaster(controller.ServerMaster):
|
|||||||
self.stream.fo.close()
|
self.stream.fo.close()
|
||||||
self.stream = None
|
self.stream = None
|
||||||
|
|
||||||
def start_stream_to_path(self, path, mode="wb"):
|
def start_stream_to_path(self, path, mode="wb", filt=None):
|
||||||
path = os.path.expanduser(path)
|
path = os.path.expanduser(path)
|
||||||
try:
|
try:
|
||||||
f = file(path, mode)
|
f = open(path, mode)
|
||||||
self.start_stream(f, None)
|
self.start_stream(f, filt)
|
||||||
except IOError as v:
|
except IOError as v:
|
||||||
return str(v)
|
return str(v)
|
||||||
self.stream_path = path
|
self.stream_path = path
|
||||||
|
Loading…
Reference in New Issue
Block a user