diff --git a/src/replaceVars.ts b/src/replaceVars.ts index 3e78449..1accb4a 100644 --- a/src/replaceVars.ts +++ b/src/replaceVars.ts @@ -137,9 +137,10 @@ export function replaceVariablesInRequest(request: RequestSpec, variables: Varia type keyOfHttp = Exclude; const httpPropertiesToReplace: string[] = ["baseUrl", "url", "params", "headers", "body"]; - httpPropertiesToReplace.forEach((key) => { - const replacedData = replaceVariables(request.httpRequest[key as keyOfHttp], variables); - request.httpRequest[key as keyOfHttp] = replacedData.data; + httpPropertiesToReplace.forEach((prop) => { + const httpKey = prop as keyOfHttp; + const replacedData = replaceVariables(request.httpRequest[httpKey], variables); + request.httpRequest[httpKey] = replacedData.data; undefs.push(...replacedData.undefinedVars); });