diff --git a/object/storage.go b/object/storage.go index 7b42d1b2..6f6c5e1d 100644 --- a/object/storage.go +++ b/object/storage.go @@ -72,17 +72,17 @@ func GetUploadFileUrl(provider *Provider, fullFilePath string, hasTimestamp bool if provider.Type == "Azure Blob" { host = util.UrlJoin(host, provider.Bucket) } - fileUrl := "" - if provider.Type == "Tencent Cloud COS" { - fileUrl = util.UrlJoin(host, objectKey) - } else { - fileUrl = util.UrlJoin(host, escapePath(objectKey)) - } + + fileUrl := util.UrlJoin(host, escapePath(objectKey)) if hasTimestamp { fileUrl = fmt.Sprintf("%s?t=%s", fileUrl, util.GetCurrentUnixTime()) } + if provider.Type == "Tencent Cloud COS" { + objectKey = escapePath(objectKey) + } + return fileUrl, objectKey }