mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 15:37:45 +00:00
combine content with header updates
This commit is contained in:
parent
61ef7ca91b
commit
ca4541613c
@ -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:
|
||||
|
@ -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 })
|
||||
|
Loading…
Reference in New Issue
Block a user