From abc86fa21641debdc4d65d193df87ec6d87874d6 Mon Sep 17 00:00:00 2001 From: tamanyan Date: Fri, 3 Oct 2025 01:06:02 +0900 Subject: [PATCH 1/2] fix(storage): remove trailing slash from baseUrl normalization --- packages/core/storage-js/src/packages/StorageBucketApi.ts | 2 +- packages/core/storage-js/test/storageBucketApi.test.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/core/storage-js/src/packages/StorageBucketApi.ts b/packages/core/storage-js/src/packages/StorageBucketApi.ts index 7bf082714..a2b7157fc 100644 --- a/packages/core/storage-js/src/packages/StorageBucketApi.ts +++ b/packages/core/storage-js/src/packages/StorageBucketApi.ts @@ -28,7 +28,7 @@ export default class StorageBucketApi { } } - this.url = baseUrl.href + this.url = baseUrl.href.replace(/\/$/, '') this.headers = { ...DEFAULT_HEADERS, ...headers } this.fetch = resolveFetch(fetch) } diff --git a/packages/core/storage-js/test/storageBucketApi.test.ts b/packages/core/storage-js/test/storageBucketApi.test.ts index cba6a6014..99fbd049d 100644 --- a/packages/core/storage-js/test/storageBucketApi.test.ts +++ b/packages/core/storage-js/test/storageBucketApi.test.ts @@ -60,6 +60,11 @@ describe('Bucket API Error Handling', () => { 'http://localhost:1234/storage/v1', 'support local host with port without modification', ], + [ + 'http://localhost:1234', + 'http://localhost:1234', + 'support local host only with port', + ], ] urlTestCases.forEach(([inputUrl, expectUrl, description]) => { From 4565db207ed17f92d43b948497b6cc780b08c60e Mon Sep 17 00:00:00 2001 From: tamanyan Date: Fri, 3 Oct 2025 01:12:56 +0900 Subject: [PATCH 2/2] chore(storage): format code --- packages/core/storage-js/test/storageBucketApi.test.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/core/storage-js/test/storageBucketApi.test.ts b/packages/core/storage-js/test/storageBucketApi.test.ts index 99fbd049d..ff9adf424 100644 --- a/packages/core/storage-js/test/storageBucketApi.test.ts +++ b/packages/core/storage-js/test/storageBucketApi.test.ts @@ -60,11 +60,7 @@ describe('Bucket API Error Handling', () => { 'http://localhost:1234/storage/v1', 'support local host with port without modification', ], - [ - 'http://localhost:1234', - 'http://localhost:1234', - 'support local host only with port', - ], + ['http://localhost:1234', 'http://localhost:1234', 'support local host only with port'], ] urlTestCases.forEach(([inputUrl, expectUrl, description]) => {