mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 02:10:59 +00:00
make file out ouf string to combine flow content updates via editor and fileupload
This commit is contained in:
parent
f84098554a
commit
121079934e
@ -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)
|
||||
|
||||
|
@ -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 }
|
||||
|
Loading…
Reference in New Issue
Block a user