mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-28 23:24:05 +00:00
Fix: Prevent interpolation of buffer values in JSON requests
This commit is contained in:
@@ -65,7 +65,11 @@ const interpolateVars = (request, envVariables = {}, runtimeVariables = {}, proc
|
||||
|
||||
const contentType = getContentType(request.headers);
|
||||
|
||||
if (contentType.includes('json')) {
|
||||
/*
|
||||
We explicitly avoid interpolating buffer values because the file content is read as a buffer object in raw body mode.
|
||||
Even if the selected file's content type is JSON, this prevents the buffer object from being interpolated.
|
||||
*/
|
||||
if (contentType.includes('json') && !Buffer.isBuffer(request.data)) {
|
||||
if (typeof request.data === 'string') {
|
||||
if (request.data.length) {
|
||||
request.data = _interpolate(request.data);
|
||||
|
||||
Reference in New Issue
Block a user