web: fix flow content update

This commit is contained in:
Maximilian Hils 2016-07-21 00:43:31 -07:00
parent 8b2a5cad2d
commit 427fffbcb8

View File

@ -8,6 +8,7 @@ import re
import six
import tornado.websocket
import tornado.web
from io import BytesIO
from mitmproxy.flow import FlowWriter, FlowReader
@ -293,19 +294,11 @@ class ReplayFlow(RequestHandler):
class FlowContent(RequestHandler):
def post (self, flow_id, message):
# handle request later now just change response content
flow = self.flow
flow.backup()
content = self.request.files.values()[0][0].body
if (message == "response"):
with models.decoded(flow.response):
flow.response.content = content
elif(message == "request"):
with models.decoded(flow.request):
flow.request.content = content
self.state.update_flow(flow)
def post(self, flow_id, message):
self.flow.backup()
message = getattr(self.flow, message)
message.content = self.request.files.values()[0][0].body
self.state.update_flow(self.flow)
def get(self, flow_id, message):
message = getattr(self.flow, message)