Fix: Prevent interpolation of buffer values in JSON requests

This commit is contained in:
sanjai0py
2025-02-11 11:51:24 +05:30
committed by Anoop M D
parent 70ee819bae
commit 7566d658d4

View File

@@ -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);