diff --git a/mitmproxy/web/app.py b/mitmproxy/web/app.py index c2d46d303..b130a6f71 100644 --- a/mitmproxy/web/app.py +++ b/mitmproxy/web/app.py @@ -297,12 +297,9 @@ class FlowContent(RequestHandler): flow = self.flow flow.backup() - content = '' + content = 'Can not read file!' if (len(self.request.files.values()) > 0): content = self.request.files.values()[0][0]["body"] - elif (len(self.request.arguments) > 0): - content = self.request.arguments['file'] - flow.response.content = str(content) self.state.update_flow(flow) diff --git a/web/src/js/ducks/flows.js b/web/src/js/ducks/flows.js index 36274f398..8815db255 100644 --- a/web/src/js/ducks/flows.js +++ b/web/src/js/ducks/flows.js @@ -119,6 +119,8 @@ export function update(flow, data) { export function update_content(flow, file) { const body = new FormData() + if (typeof file !== File) + file = new Blob([file], {type: 'plain/text'}) body.append('file', file) fetchApi(`/flows/${flow.id}/response/content`, {method: 'post', body} ) return { type: REQUEST_ACTION }