Skip to content

Commit

Permalink
feat: include uncommon port in image link
Browse files Browse the repository at this point in the history
  • Loading branch information
laggage committed Nov 19, 2023
1 parent 7322f92 commit d05144c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/image-upload.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export class ImageUploadService {
// eslint-disable-next-line @typescript-eslint/naming-convention
'Content-Type': mime.contentType(fileExt),
});
return `${minioClientOption.useSSL ? 'https' : 'http'}://${minioClientOption.endPoint}/${bucketName}${filePath
const { port, endPoint } = minioClientOption;
return `${minioClientOption.useSSL ? 'https' : 'http'}://${endPoint}${ port == null || port === 80 || port === 443 ? '' : port }/${bucketName}${filePath
.split('/')
.map(x => encodeURI(x))
.join('/')}`;
Expand Down

3 comments on commit d05144c

@ly40
Copy link

@ly40 ly40 commented on d05144c Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The colon between endPoint and port was not added.

@laggage
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The colon between endPoint and port was not added.

Greate catch, thanks, I will fix as soon as possible

@ly40
Copy link

@ly40 ly40 commented on d05144c Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The colon between endPoint and port was not added.

Greate catch, thanks, I will fix as soon as possible

it's really great
0582AFFC
The response is very timely, and the plugin is very user-friendly.

Please sign in to comment.