mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-01 00:24:08 +00:00
fix: multipart/form-data body interpolation (#3142)
* feat: updates * feat: updates * feat: updates * feat: updates
This commit is contained in:
@@ -120,16 +120,10 @@ const prepareRequest = (request, collectionRoot) => {
|
||||
}
|
||||
|
||||
if (request.body.mode === 'multipartForm') {
|
||||
axiosRequest.headers['content-type'] = 'multipart/form-data';
|
||||
const params = {};
|
||||
const enabledParams = filter(request.body.multipartForm, (p) => p.enabled);
|
||||
each(enabledParams, (p) => {
|
||||
if (p.type === 'file') {
|
||||
params[p.name] = p.value.map((path) => fs.createReadStream(path));
|
||||
} else {
|
||||
params[p.name] = p.value;
|
||||
}
|
||||
});
|
||||
axiosRequest.headers['content-type'] = 'multipart/form-data';
|
||||
each(enabledParams, (p) => (params[p.name] = p.value));
|
||||
axiosRequest.data = params;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user