mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-03 01:18:32 +00:00
feat: Multipart Form Data file uploads (#1130)
* Add multipart form files upload support * clean up * Fixed electron files browser for Multipart Form files * Using relative paths for files inside the collection's folder --------- Co-authored-by: Mateo Gallardo <mateogallardo@gmail.com>
This commit is contained in:
@@ -109,6 +109,7 @@ const prepareRequest = (request, collectionRoot) => {
|
||||
each(enabledParams, (p) => (params[p.name] = p.value));
|
||||
axiosRequest.headers['content-type'] = 'multipart/form-data';
|
||||
axiosRequest.data = params;
|
||||
// TODO is it needed here as well ?
|
||||
}
|
||||
|
||||
if (request.body.mode === 'graphql') {
|
||||
|
||||
@@ -40,6 +40,7 @@ const runSingleRequest = async function (
|
||||
// make axios work in node using form data
|
||||
// reference: https://github.com/axios/axios/issues/1006#issuecomment-320165427
|
||||
if (request.headers && request.headers['content-type'] === 'multipart/form-data') {
|
||||
// TODO remove ?
|
||||
const form = new FormData();
|
||||
forOwn(request.data, (value, key) => {
|
||||
form.append(key, value);
|
||||
|
||||
Reference in New Issue
Block a user