mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
web: fix flow content update
This commit is contained in:
parent
8b2a5cad2d
commit
427fffbcb8
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user