fix: minio bucket url

pull/931/head
withchao 2 years ago
parent 0aea35994f
commit 9937a575d1

@ -78,7 +78,6 @@ func NewMinio() (s3.Interface, error) {
} }
m := &Minio{ m := &Minio{
bucket: conf.Bucket, bucket: conf.Bucket,
bucketURL: conf.Endpoint + "/" + conf.Bucket + "/",
core: &minio.Core{Client: client}, core: &minio.Core{Client: client},
lock: &sync.Mutex{}, lock: &sync.Mutex{},
init: false, init: false,
@ -86,6 +85,7 @@ func NewMinio() (s3.Interface, error) {
if conf.SignEndpoint == "" || conf.SignEndpoint == conf.Endpoint { if conf.SignEndpoint == "" || conf.SignEndpoint == conf.Endpoint {
m.opts = opts m.opts = opts
m.sign = m.core.Client m.sign = m.core.Client
m.bucketURL = conf.Endpoint + "/" + conf.Bucket + "/"
} else { } else {
su, err := url.Parse(conf.SignEndpoint) su, err := url.Parse(conf.SignEndpoint)
if err != nil { if err != nil {
@ -99,6 +99,7 @@ func NewMinio() (s3.Interface, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
m.bucketURL = conf.SignEndpoint + "/" + conf.Bucket + "/"
} }
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel() defer cancel()

Loading…
Cancel
Save