mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-27 14:44:07 +00:00
Add Buffer.isBuffer() check to skip interpolation for Buffer data (e.g., gzip-compressed bodies). (#6922)
Co-authored-by: Sora Iwamoto <rockbook2025@gmail.com>
This commit is contained in:
@@ -67,7 +67,8 @@ const interpolateVars = (request, envVariables = {}, runtimeVariables = {}, proc
|
||||
const contentType = getContentType(request.headers);
|
||||
|
||||
if (contentType.includes('json')) {
|
||||
if (typeof request.data === 'object') {
|
||||
// Skip interpolation if data is a Buffer (e.g., gzip-compressed data)
|
||||
if (typeof request.data === 'object' && !Buffer.isBuffer(request.data)) {
|
||||
try {
|
||||
let parsed = JSON.stringify(request.data);
|
||||
parsed = _interpolate(parsed, { escapeJSONStrings: true });
|
||||
|
||||
Reference in New Issue
Block a user