diff --git a/mitmproxy/web/app.py b/mitmproxy/web/app.py index 76da8591c..848ca4741 100644 --- a/mitmproxy/web/app.py +++ b/mitmproxy/web/app.py @@ -251,11 +251,14 @@ class FlowHandler(RequestHandler): request.port = int(v) elif k == "headers": request.headers.set_state(v) + elif k == "content": + request.text = v else: print("Warning: Unknown update {}.{}: {}".format(a, k, v)) elif a == "response": response = flow.response + for k, v in six.iteritems(b): if k == "msg": response.msg = str(v) @@ -265,6 +268,8 @@ class FlowHandler(RequestHandler): response.http_version = str(v) elif k == "headers": response.headers.set_state(v) + elif k == "content": + response.text = v else: print("Warning: Unknown update {}.{}: {}".format(a, k, v)) else: diff --git a/web/src/js/ducks/ui/flow.js b/web/src/js/ducks/ui/flow.js index 62304994f..d77af420f 100644 --- a/web/src/js/ducks/ui/flow.js +++ b/web/src/js/ducks/ui/flow.js @@ -94,15 +94,6 @@ export function updateEdit(update) { export function stopEdit(flow, modified_flow) { let diff = getDiff(flow, modified_flow) return (dispatch) => { - if (diff.response && diff.response.content) { - dispatch(flowsActions.updateContent(flow, diff.response.content, "response")) - delete diff.response.content - } - if (diff.request && diff.request.content) { - dispatch(flowsActions.updateContent(flow, diff.request.content, "request")) - delete diff.request.content - } - dispatch(flowsActions.update(flow, diff)).then(() => { dispatch(flowsActions.updateFlow(modified_flow)) dispatch({ type: STOP_EDIT })