aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy
diff options
context:
space:
mode:
authorMatthew Shao <me@matshao.com>2017-08-15 22:21:08 +0800
committerMatthew Shao <me@matshao.com>2017-08-15 22:21:08 +0800
commit6560b0dcdba72085ce6c53d68a9e01d293936893 (patch)
tree3ed2f055f1dda762a3aaa4ac1524ebf305aabe27 /mitmproxy
parentcbdddefcc8f3ad19e50da5a31532c8abb0cb36f8 (diff)
downloadmitmproxy-6560b0dcdba72085ce6c53d68a9e01d293936893.tar.gz
mitmproxy-6560b0dcdba72085ce6c53d68a9e01d293936893.tar.bz2
mitmproxy-6560b0dcdba72085ce6c53d68a9e01d293936893.zip
[web] Change the api routing and minor fix.
Diffstat (limited to 'mitmproxy')
-rw-r--r--mitmproxy/tools/web/app.py14
-rw-r--r--mitmproxy/tools/web/static_viewer.py2
2 files changed, 8 insertions, 8 deletions
diff --git a/mitmproxy/tools/web/app.py b/mitmproxy/tools/web/app.py
index 2a6f6c9e..52bac8b0 100644
--- a/mitmproxy/tools/web/app.py
+++ b/mitmproxy/tools/web/app.py
@@ -466,10 +466,10 @@ class Application(tornado.web.Application):
self.master = master
handlers = [
(r"/", IndexHandler),
- (r"/filter-help", FilterHelp),
+ (r"/filter-help(?:\.json)?", FilterHelp),
(r"/updates", ClientConnection),
- (r"/events", Events),
- (r"/flows", Flows),
+ (r"/events(?:\.json)?", Events),
+ (r"/flows(?:\.json)?", Flows),
(r"/flows/dump", DumpFlows),
(r"/flows/resume", ResumeFlows),
(r"/flows/kill", KillFlows),
@@ -479,13 +479,13 @@ class Application(tornado.web.Application):
(r"/flows/(?P<flow_id>[0-9a-f\-]+)/duplicate", DuplicateFlow),
(r"/flows/(?P<flow_id>[0-9a-f\-]+)/replay", ReplayFlow),
(r"/flows/(?P<flow_id>[0-9a-f\-]+)/revert", RevertFlow),
- (r"/flows/(?P<flow_id>[0-9a-f\-]+)/(?P<message>request|response)/content", FlowContent),
+ (r"/flows/(?P<flow_id>[0-9a-f\-]+)/(?P<message>request|response)/_content", FlowContent),
(
- r"/flows/(?P<flow_id>[0-9a-f\-]+)/(?P<message>request|response)/content/(?P<content_view>[0-9a-zA-Z\-\_]+)",
+ r"/flows/(?P<flow_id>[0-9a-f\-]+)/(?P<message>request|response)/content/(?P<content_view>[0-9a-zA-Z\-\_]+)(?:\.json)?",
FlowContentView),
- (r"/settings", Settings),
+ (r"/settings(?:\.json)?", Settings),
(r"/clear", ClearAll),
- (r"/options", Options),
+ (r"/options(?:\.json)?", Options),
(r"/options/save", SaveOptions)
]
settings = dict(
diff --git a/mitmproxy/tools/web/static_viewer.py b/mitmproxy/tools/web/static_viewer.py
index 23228b3b..01ecc3bb 100644
--- a/mitmproxy/tools/web/static_viewer.py
+++ b/mitmproxy/tools/web/static_viewer.py
@@ -54,7 +54,7 @@ class StaticViewer:
path = os.path.join(self.path, 'flows', f.id, m)
if not os.path.exists(path):
os.makedirs(path)
- with open(os.path.join(path, 'content.json'), 'wb') as content_file:
+ with open(os.path.join(path, '_content'), 'wb') as content_file:
content_file.write(message.raw_content)
# content_view