aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/tools
diff options
context:
space:
mode:
Diffstat (limited to 'mitmproxy/tools')
-rw-r--r--mitmproxy/tools/web/app.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/mitmproxy/tools/web/app.py b/mitmproxy/tools/web/app.py
index c55c0cb5..8b4a39b6 100644
--- a/mitmproxy/tools/web/app.py
+++ b/mitmproxy/tools/web/app.py
@@ -17,6 +17,7 @@ from mitmproxy import http
from mitmproxy import io
from mitmproxy import log
from mitmproxy import version
+from mitmproxy import optmanager
import mitmproxy.tools.web.master # noqa
@@ -438,6 +439,18 @@ class Settings(RequestHandler):
self.master.options.update(**update)
+class Options(RequestHandler):
+ def get(self):
+ self.write(optmanager.dump_dicts(self.master.options))
+
+ def put(self):
+ update = self.json
+ try:
+ self.master.options.update(**update)
+ except (KeyError, TypeError) as err:
+ raise APIError(400, "{}".format(err))
+
+
class Application(tornado.web.Application):
def __init__(self, master, debug):
self.master = master
@@ -462,6 +475,7 @@ class Application(tornado.web.Application):
FlowContentView),
(r"/settings", Settings),
(r"/clear", ClearAll),
+ (r"/options", Options)
]
settings = dict(
template_path=os.path.join(os.path.dirname(__file__), "templates"),