From 73bf8c055f977976f178ccf733df6e701c824d18 Mon Sep 17 00:00:00 2001 From: becem-gharbi Date: Sun, 14 Jan 2024 18:45:04 +0100 Subject: [PATCH] fix(s3): Remove trailing slash on key normalization --- src/drivers/s3.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/s3.ts b/src/drivers/s3.ts index e3a257b7..6ef0f5ff 100644 --- a/src/drivers/s3.ts +++ b/src/drivers/s3.ts @@ -62,7 +62,7 @@ export default defineDriver((options: S3DriverOptions) => { return awsClient } - const normalizedKey = (key: string) => key.replace(/:/g, "/") + const normalizedKey = (key: string) => key.replace(/:/g, "/").replace(/\/+$/, '') const awsUrlWithoutKey = joinURL(options.endpoint, options.bucket);