mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-01-16 12:04:10 +08:00
refactor: Simplify endpoint handling in S3 client initialization
This commit is contained in:
parent
68dd9d608f
commit
d060edab23
2 changed files with 2 additions and 3 deletions
|
|
@ -46,8 +46,7 @@ func NewS3Client(vars map[string]interface{}) (*s3Client, error) {
|
|||
client := s3.NewFromConfig(cfg, func(o *s3.Options) {
|
||||
o.UsePathStyle = mode == "path"
|
||||
if endpoint != "" {
|
||||
base := normalizeEndpoint(endpoint)
|
||||
o.BaseEndpoint = aws.String(base)
|
||||
o.BaseEndpoint = aws.String(normalizeEndpoint(endpoint))
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ func NewS3Client(vars map[string]interface{}) (*s3Client, error) {
|
|||
client := s3.NewFromConfig(cfg, func(o *s3.Options) {
|
||||
o.UsePathStyle = mode == "path"
|
||||
if endpoint != "" {
|
||||
o.EndpointResolver = s3.EndpointResolverFromURL(normalizeEndpoint(endpoint))
|
||||
o.BaseEndpoint = aws.String(normalizeEndpoint(endpoint))
|
||||
}
|
||||
})
|
||||
return &s3Client{scType: scType, bucket: bucket, client: client}, nil
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue