Skip to content

Commit 89792d4

Browse files
kaumudpaclaude
andcommitted
fix(storage): handle local storage in getCurrentBucketUrl()
Fixed bug where getCurrentBucketUrl() returned empty string for local storage provider, which would cause broken file URLs if the save-media endpoint was called with local storage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 514ed1e commit 89792d4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libraries/nestjs-libraries/src/upload/s3.utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ export function getCurrentBucketUrl(): string {
8282
return getS3BucketUrlFromEnv();
8383
case 'cloudflare':
8484
return (process.env.CLOUDFLARE_BUCKET_URL || '').replace(/\/$/, '');
85+
case 'local':
86+
// Local storage uses FRONTEND_URL/uploads as the base URL
87+
return (process.env.FRONTEND_URL || '').replace(/\/$/, '') + '/uploads';
8588
default:
8689
return '';
8790
}

0 commit comments

Comments
 (0)