fix web master options leftovers

This commit is contained in:
Maximilian Hils 2016-07-19 03:11:17 -07:00
parent 329909c514
commit 4ea6e61ea8
2 changed files with 8 additions and 7 deletions

View File

@ -118,6 +118,7 @@ class RequestHandler(BasicAuth, tornado.web.RequestHandler):
@property
def master(self):
# type: () -> mitmproxy.web.master.WebMaster
return self.application.master
@property
@ -337,7 +338,7 @@ class Settings(RequestHandler):
data=dict(
version=version.VERSION,
mode=str(self.master.options.mode),
intercept=self.state.intercept_txt,
intercept=self.master.options.intercept,
showhost=self.master.options.showhost,
no_upstream_cert=self.master.options.no_upstream_cert,
rawtcp=self.master.options.rawtcp,
@ -345,8 +346,8 @@ class Settings(RequestHandler):
anticache=self.master.options.anticache,
anticomp=self.master.options.anticomp,
stickyauth=self.master.options.stickyauth,
stickycookie=self.master.stickycookie_txt,
stream= self.master.stream_large_bodies.max_size if self.master.stream_large_bodies else False
stickycookie=self.master.options.stickycookie,
stream= self.master.options.stream_large_bodies
)
))
@ -354,7 +355,7 @@ class Settings(RequestHandler):
update = {}
for k, v in six.iteritems(self.json):
if k == "intercept":
self.state.set_intercept(v)
self.master.options.intercept = v
update[k] = v
elif k == "showhost":
self.master.options.showhost = v
@ -375,13 +376,13 @@ class Settings(RequestHandler):
self.master.options.anticomp = v
update[k] = v
elif k == "stickycookie":
self.master.set_stickycookie(v)
self.master.options.stickycookie = v
update[k] = v
elif k == "stickyauth":
self.master.options.stickyauth = v
update[k] = v
elif k == "stream":
self.master.set_stream_large_bodies(v)
self.master.options.stream_large_bodies = v
update[k] = v
else:
print("Warning: Unknown setting {}: {}".format(k, v))

View File

@ -94,7 +94,7 @@ class WebState(flow.State):
class Options(flow.options.Options):
def __init__(
self,
intercept=False, # type: bool
intercept=None, # type: Optional[str]
wdebug=bool, # type: bool
wport=8081, # type: int
wiface="127.0.0.1", # type: str