test-v3dev1
withchao 1 year ago
parent 84f8074d6a
commit 406a77d5b8

@ -233,14 +233,14 @@ func (c *Cos) ListUploadedParts(ctx context.Context, uploadID string, name strin
func (c *Cos) AccessURL(ctx context.Context, name string, expire time.Duration, opt *s3.AccessURLOption) (string, error) {
reqParams := make(url.Values)
if opt != nil {
if opt.ContentType != "" {
reqParams.Set("Content-Type", opt.ContentType)
}
if opt.ContentDisposition != "" {
reqParams.Set("Content-Disposition", opt.ContentDisposition)
}
}
//if opt != nil {
// if opt.ContentType != "" {
// reqParams.Set("Content-Type", opt.ContentType)
// }
// if opt.ContentDisposition != "" {
// reqParams.Set("Content-Disposition", opt.ContentDisposition)
// }
//}
if expire <= 0 {
expire = time.Hour * 24 * 365 * 99 // 99 years
} else if expire < time.Second {

@ -229,14 +229,14 @@ func (m *Minio) ListUploadedParts(ctx context.Context, uploadID string, name str
func (m *Minio) AccessURL(ctx context.Context, name string, expire time.Duration, opt *s3.AccessURLOption) (string, error) {
reqParams := make(url.Values)
if opt != nil {
if opt.ContentType != "" {
reqParams.Set("Content-Type", opt.ContentType)
}
if opt.ContentDisposition != "" {
reqParams.Set("Content-Disposition", opt.ContentDisposition)
}
}
//if opt != nil {
// if opt.ContentType != "" {
// reqParams.Set("Content-Type", opt.ContentType)
// }
// if opt.ContentDisposition != "" {
// reqParams.Set("Content-Disposition", opt.ContentDisposition)
// }
//}
if expire <= 0 {
expire = time.Hour * 24 * 365 * 99 // 99 years
} else if expire < time.Second {

@ -242,14 +242,14 @@ func (o *OSS) ListUploadedParts(ctx context.Context, uploadID string, name strin
func (o *OSS) AccessURL(ctx context.Context, name string, expire time.Duration, opt *s3.AccessURLOption) (string, error) {
var opts []oss.Option
if opt != nil {
if opt.ContentType != "" {
opts = append(opts, oss.ContentType(opt.ContentType))
}
if opt.ContentDisposition != "" {
opts = append(opts, oss.ContentDisposition(opt.ContentDisposition))
}
}
//if opt != nil {
// if opt.ContentType != "" {
// opts = append(opts, oss.ContentType(opt.ContentType))
// }
// if opt.ContentDisposition != "" {
// opts = append(opts, oss.ContentDisposition(opt.ContentDisposition))
// }
//}
if expire <= 0 {
expire = time.Hour * 24 * 365 * 99 // 99 years
} else if expire < time.Second {

Loading…
Cancel
Save