Feat: Support multipart/mixed (#7155)

* feat(): support multipart mixed

fix: support vars interpolation on mixed multi-part

Update packages/bruno-electron/src/ipc/network/interpolate-vars.js

Co-authored-by: Timon <39559178+Its-treason@users.noreply.github.com>

refactor: use startsWith

feat: best effort for other multipart/* contentypes

* feat: enhance variable interpolation for multipart requests

- Updated `interpolateVars` function to support interpolation in multipart/form-data and multipart/mixed requests.
- Added handling for empty multipart arrays and parts with missing or undefined values.
- Improved type checks for content types to ensure proper interpolation behavior.

Includes new tests to validate the interpolation functionality for multipart requests.

* fix: normalize error handling in sendRequest and improve test reliability

---------

Co-authored-by: Alfonso Presa <alfonso-presa@users.noreply.github.com>
This commit is contained in:
Pragadesh-45
2026-02-26 17:43:37 +05:30
committed by GitHub
parent 234d0df449
commit b0d0e4aabc
8 changed files with 180 additions and 18 deletions

View File

@@ -58,9 +58,16 @@ const createSendRequest = (config?: SendRequestConfig) => {
} catch (error) {
return Promise.reject(error);
}
} catch (error) {
} catch (error: any) {
// Normalize axios error for callback: tests expect error.status (e.g. 404), but axios
// puts the status on error.response.status. Setting status here ensures the same
// behaviour in nodevm (--sandbox developer, used in CI) and in QuickJS (safe sandbox).
const errForCallback
= error && typeof error.response?.status === 'number'
? { ...error, status: error.response.status }
: error;
try {
await callback(error, null);
await callback(errForCallback, null);
} catch (err) {
return Promise.reject(err);
}