From 31419991cc6d17214f2b4fa2b6d8b03cc8acd207 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 29 Nov 2021 10:42:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- modules/storage/obs.go | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/modules/storage/obs.go b/modules/storage/obs.go index 691c0bb8c..369333faf 100755 --- a/modules/storage/obs.go +++ b/modules/storage/obs.go @@ -454,30 +454,7 @@ func ObsGenMultiPartSignedUrl(uuid string, uploadId string, partNumber int, file return output.SignedUrl, nil } -func GetObsCreateSignedUrlByBucketAndKey(bucket, key string) (string, error) { - input := &obs.CreateSignedUrlInput{} - input.Bucket = bucket - input.Key = key - input.Expires = 60 * 60 - input.Method = obs.HttpMethodGet - comma := strings.LastIndex(key, "/") - filename := key - if comma != -1 { - filename = key[comma+1:] - } - reqParams := make(map[string]string) - filename = url.QueryEscape(filename) - reqParams["response-content-disposition"] = "attachment; filename=\"" + filename + "\"" - input.QueryParams = reqParams - output, err := ObsCli.CreateSignedUrl(input) - if err != nil { - log.Error("CreateSignedUrl failed:", err.Error()) - return "", err - } - log.Info("SignedUrl:%s", output.SignedUrl) - return output.SignedUrl, nil -} func GetObsCreateSignedUrlByBucketAndKey(bucket, key string) (string, error) { input := &obs.CreateSignedUrlInput{} @@ -501,7 +478,8 @@ func GetObsCreateSignedUrlByBucketAndKey(bucket, key string) (string, error) { return "", err } - return output.SignedUrl, nil} + return output.SignedUrl, nil +} func GetObsCreateSignedUrl(jobName, parentDir, fileName string) (string, error) { // input := &obs.CreateSignedUrlInput{}