aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mitmproxy/tools/web/static_viewer.py12
-rw-r--r--web/src/js/flow/utils.js4
-rw-r--r--web/src/js/utils.js2
3 files changed, 9 insertions, 9 deletions
diff --git a/mitmproxy/tools/web/static_viewer.py b/mitmproxy/tools/web/static_viewer.py
index 20815fcd..23228b3b 100644
--- a/mitmproxy/tools/web/static_viewer.py
+++ b/mitmproxy/tools/web/static_viewer.py
@@ -41,7 +41,7 @@ class StaticViewer:
self.flows.add(i)
def save_flows(self) -> None:
- with open(os.path.join(self.path, '_flows'), 'w') as file:
+ with open(os.path.join(self.path, 'flows.json'), 'w') as file:
flows = []
for f in self.flows:
flows.append(flow_to_json(f))
@@ -54,8 +54,8 @@ 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'), 'wb') as file:
- file.write(message.raw_content)
+ with open(os.path.join(path, 'content.json'), 'wb') as content_file:
+ content_file.write(message.raw_content)
# content_view
view_path = os.path.join(path, 'content')
@@ -64,11 +64,11 @@ class StaticViewer:
description, lines, error = contentviews.get_message_content_view(
'Auto', message
)
- with open(os.path.join(view_path, 'Auto'), 'w') as file:
+ with open(os.path.join(view_path, 'Auto.json'), 'w') as view_file:
json.dump(dict(
lines=list(lines),
description=description
- ), file)
+ ), view_file)
def save_static(self) -> None:
"""
@@ -100,5 +100,5 @@ class StaticViewer:
static.close()
def save_filter_help(self) -> None:
- with open(os.path.join(self.path, '_filter-help'), 'w') as file:
+ with open(os.path.join(self.path, 'filter-help.json'), 'w') as file:
json.dump(dict(commands=flowfilter.help), file)
diff --git a/web/src/js/flow/utils.js b/web/src/js/flow/utils.js
index 9d4e1012..cb37822a 100644
--- a/web/src/js/flow/utils.js
+++ b/web/src/js/flow/utils.js
@@ -51,8 +51,8 @@ export var MessageUtils = {
}
if (global.MITMWEB_STATIC) {
let url = view ?
- `/flows/${flow.id}/${message}/content/${view}` :
- `/flows/${flow.id}/${message}/_content`
+ `/flows/${flow.id}/${message}/content/${view}.json` :
+ `/flows/${flow.id}/${message}/content.json`
return url;
} else {
return `/flows/${flow.id}/${message}/content` + (view ? `/${view}` : '');
diff --git a/web/src/js/utils.js b/web/src/js/utils.js
index 68daa1ad..505f74df 100644
--- a/web/src/js/utils.js
+++ b/web/src/js/utils.js
@@ -86,7 +86,7 @@ export function fetchApi(url, options={}) {
if (global.MITMWEB_STATIC) {
let path = url.split('/'),
filename = path.pop()
- filename = '_' + filename
+ filename += '.json'
path.push(filename)
let new_url = path.join('/')
return _fetchApi(new_url, options)