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 : ""); }, };