From f5041038527d7e1097efdff31bdba43674d3fe0f Mon Sep 17 00:00:00 2001 From: Artem Derevnjuk Date: Fri, 21 Jun 2024 19:58:55 +0400 Subject: [PATCH] fix(repeater): decode base64 bodies before scripts closes #552 --- src/RequestExecutor/HttpRequestExecutor.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/RequestExecutor/HttpRequestExecutor.ts b/src/RequestExecutor/HttpRequestExecutor.ts index 6c7fc130..191bef68 100644 --- a/src/RequestExecutor/HttpRequestExecutor.ts +++ b/src/RequestExecutor/HttpRequestExecutor.ts @@ -363,7 +363,12 @@ export class HttpRequestExecutor implements RequestExecutor { const result = await vm.exec( this.DEFAULT_SCRIPT_ENTRYPOINT, - script.toJSON() + { + ...script.toJSON(), + body: script.encoding + ? iconv.encode(script.body, script.encoding).toString() + : script.body + } ); return new Request(result);