Skip to content

Commit 11dc573

Browse files
committed
Fix public buckets doesn't need to save with baseurl
1 parent ee7b219 commit 11dc573

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/minio.service.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,7 @@ export class MinioService implements OnModuleInit {
8686
'Content-Type': file.mimetype,
8787
});
8888

89-
// If public bucket, return direct URL
90-
if (this.config.buckets.public.includes(bucketName)) {
91-
const endpoint = this.config.externalEndPoint || this.config.endPoint;
92-
const protocol = (this.config.externalUseSSL ?? this.config.useSSL) ? 'https' : 'http';
93-
return `${protocol}://${endpoint}${
94-
this.config.port ? `:${this.config.port}` : ''
95-
}/${bucketName}/${fileName}`;
96-
} else {
97-
// For private buckets, return the path only
98-
return `${bucketName}/${fileName}`;
99-
}
89+
return `${bucketName}/${fileName}`;
10090
}
10191

10292
async getPresignedUrl(bucketName: string, objectName: string): Promise<string> {

0 commit comments

Comments
 (0)