From 2c3ddb0ecc3d57b099057ede73da5576655b0583 Mon Sep 17 00:00:00 2001 From: Clemens Date: Wed, 27 Jul 2016 10:21:06 +0200 Subject: [PATCH] add parameter to content requests --- mitmproxy/web/app.py | 1 + web/src/js/flow/utils.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mitmproxy/web/app.py b/mitmproxy/web/app.py index 812aa680a..5f756ed1d 100644 --- a/mitmproxy/web/app.py +++ b/mitmproxy/web/app.py @@ -314,6 +314,7 @@ class FlowContent(RequestHandler): def get(self, flow_id, message): message = getattr(self.flow, message) + contentview = self.get_argument("content_view", "raw", True) if not message.raw_content: raise APIError(400, "No content.") diff --git a/web/src/js/flow/utils.js b/web/src/js/flow/utils.js index d24f984ca..0232e7533 100644 --- a/web/src/js/flow/utils.js +++ b/web/src/js/flow/utils.js @@ -43,13 +43,13 @@ export var MessageUtils = { } return false; }, - getContentURL: function (flow, message) { + getContentURL: function (flow, message, view) { if (message === flow.request) { message = "request"; } else if (message === flow.response) { message = "response"; } - return "/flows/" + flow.id + "/" + message + "/content"; + return "/flows/" + flow.id + "/" + message + "/content" + (view ? "?content_view="+view : ""); }, };