Browse Source

Merge branch 'V20220415' into fix-1653

pull/1856/head
wangjr 3 years ago
parent
commit
fd18fa2da8
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      modules/storage/obs.go

+ 2
- 1
modules/storage/obs.go View File

@@ -480,7 +480,7 @@ func GetObsCreateSignedUrlByBucketAndKey(bucket, key string) (string, error) {
filename = key[comma+1:]
}
reqParams := make(map[string]string)
filename = url.QueryEscape(filename)
filename = url.PathEscape(filename)
reqParams["response-content-disposition"] = "attachment; filename=\"" + filename + "\""
input.QueryParams = reqParams
output, err := ObsCli.CreateSignedUrl(input)
@@ -503,6 +503,7 @@ func ObsGetPreSignedUrl(uuid, fileName string) (string, error) {
input.Bucket = setting.Bucket
input.Expires = 60 * 60

fileName = url.PathEscape(fileName)
reqParams := make(map[string]string)
reqParams["response-content-disposition"] = "attachment; filename=\"" + fileName + "\""
input.QueryParams = reqParams


Loading…
Cancel
Save