mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-29 19:08:44 +00:00
Add POST /options RESTful API for mitmweb.
This commit is contained in:
parent
9687d67601
commit
ab162361a1
@ -443,6 +443,14 @@ 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):
|
||||
|
Loading…
Reference in New Issue
Block a user