From 4ea6e61ea8ba57895451a9f76ec2c5e3c02829f3 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 19 Jul 2016 03:11:17 -0700 Subject: [PATCH] fix web master options leftovers --- mitmproxy/web/app.py | 13 +++++++------ mitmproxy/web/master.py | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/mitmproxy/web/app.py b/mitmproxy/web/app.py index b643f97e7..50e859233 100644 --- a/mitmproxy/web/app.py +++ b/mitmproxy/web/app.py @@ -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)) diff --git a/mitmproxy/web/master.py b/mitmproxy/web/master.py index 83f18539f..a0d681914 100644 --- a/mitmproxy/web/master.py +++ b/mitmproxy/web/master.py @@ -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