From 4d418b5e942075cff6b392bf03a369537240b917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torgeir=20=C3=98verland?= Date: Tue, 2 Aug 2022 12:15:38 +0200 Subject: [PATCH 1/2] Remove wrong paranthese --- src/templates/core/node/getRequestBody.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/templates/core/node/getRequestBody.hbs b/src/templates/core/node/getRequestBody.hbs index 5162ffd60..50e3ad69d 100644 --- a/src/templates/core/node/getRequestBody.hbs +++ b/src/templates/core/node/getRequestBody.hbs @@ -3,7 +3,7 @@ function getRequestBody(options: ApiRequestOptions): BodyInit | undefined { return getFormData(options.formData) as BodyInit; } if (options.body) { - if (isString(options.body) || isBinary(options.body) || options.body instanceof Stream)) { + if (isString(options.body) || isBinary(options.body) || options.body instanceof Stream) { return options.body as BodyInit; } else { return JSON.stringify(options.body); From aa01893526f234f7633eb8f5d667d5749ff5f8d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torgeir=20=C3=98verland?= Date: Tue, 2 Aug 2022 12:19:34 +0200 Subject: [PATCH 2/2] Add correct header for Stream request --- src/templates/core/node/getHeaders.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/templates/core/node/getHeaders.hbs b/src/templates/core/node/getHeaders.hbs index e4ee40b2c..52d552371 100644 --- a/src/templates/core/node/getHeaders.hbs +++ b/src/templates/core/node/getHeaders.hbs @@ -19,7 +19,7 @@ async function getHeaders(options: ApiRequestOptions): Promise { } if (options.body) { - if (isBinary(options.body)) { + if (isBinary(options.body) || options.body instanceof Stream) { headers.append('Content-Type', 'application/octet-stream'); } else if (isString(options.body)) { headers.append('Content-Type', 'text/plain');