From c4bfb056e765553b8c68a8951f53a236e7d36cb0 Mon Sep 17 00:00:00 2001 From: oleiade Date: Tue, 15 Aug 2023 14:16:18 +0200 Subject: [PATCH] Ensure s3 requests send a null body when unset --- src/internal/s3.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/internal/s3.ts b/src/internal/s3.ts index 95be9db..fd0c525 100644 --- a/src/internal/s3.ts +++ b/src/internal/s3.ts @@ -56,7 +56,7 @@ export class S3Client extends AWSClient { {} ) - const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || '', { + const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || null, { headers: signedRequest.headers, }) this._handle_error('ListBuckets', res) @@ -118,7 +118,7 @@ export class S3Client extends AWSClient { {} ) - const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || '', { + const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || null, { headers: signedRequest.headers, }) this._handle_error('ListObjectsV2', res) @@ -183,7 +183,7 @@ export class S3Client extends AWSClient { {} ) - const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || '', { + const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || null, { headers: signedRequest.headers, }) this._handle_error('GetObject', res) @@ -266,7 +266,7 @@ export class S3Client extends AWSClient { {} ) - const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || '', { + const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || null, { headers: signedRequest.headers, }) this._handle_error('DeleteObject', res) @@ -339,7 +339,7 @@ export class S3Client extends AWSClient { {} ) - const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || '', { + const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || null, { headers: signedRequest.headers, }) this._handle_error('CreateMultipartUpload', res) @@ -388,7 +388,7 @@ export class S3Client extends AWSClient { {} ) - const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || '', { + const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || null, { headers: signedRequest.headers, }) this._handle_error('UploadPart', res) @@ -436,7 +436,7 @@ export class S3Client extends AWSClient { {} ) - const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || '', { + const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || null, { headers: signedRequest.headers, }) @@ -470,7 +470,7 @@ export class S3Client extends AWSClient { {} ) - const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || '', { + const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || null, { headers: signedRequest.headers, }) this._handle_error('AbortMultipartUpload', res)