aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-04-30 09:54:49 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-04-30 09:54:49 +1200
commit3365acf69fcc269c52dac405f674cc094faeb64c (patch)
treed8310a77b7048c03774252e300fbd6b12dbd752a /libpathod
parent24b0acbfab0e6fcc65c2fc3ff924a1df3d72fa92 (diff)
downloadmitmproxy-3365acf69fcc269c52dac405f674cc094faeb64c.tar.gz
mitmproxy-3365acf69fcc269c52dac405f674cc094faeb64c.tar.bz2
mitmproxy-3365acf69fcc269c52dac405f674cc094faeb64c.zip
Clear log API.
Diffstat (limited to 'libpathod')
-rw-r--r--libpathod/app.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/libpathod/app.py b/libpathod/app.py
index 7059f9ba..ca24c62c 100644
--- a/libpathod/app.py
+++ b/libpathod/app.py
@@ -12,6 +12,12 @@ class APILog(tornado.web.RequestHandler):
)
+class APILogClear(tornado.web.RequestHandler):
+ def post(self):
+ self.application.clear_log()
+ self.write("OK")
+
+
class _Page(tornado.web.RequestHandler):
def render(self, name, **kwargs):
tornado.web.RequestHandler.render(self, name + ".html", **kwargs)
@@ -129,6 +135,7 @@ class PathodApp(tornado.web.Application):
(r"/help", Help),
(r"/preview", Preview),
(r"/api/log", APILog),
+ (r"/api/log/clear", APILogClear),
(r"/p/.*", RequestPathod, settings),
],
static_path = utils.data.path("static"),