mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-07-01 02:24:47 +08:00
Merge pull request #9253 from ioito/hotfix/qx-azure-storageaccount-temp-url
fix(region): temp url sign wrong
This commit is contained in:
@@ -549,11 +549,10 @@ func (self *SContainer) SignUrl(method string, key string, expire time.Duration)
|
||||
return "", errors.Wrap(err, "getBlobServiceClient")
|
||||
}
|
||||
containerRef := blobService.GetContainerReference(self.Name)
|
||||
sas := storage.ContainerSASOptions{}
|
||||
sas := storage.BlobSASOptions{}
|
||||
sas.Start = time.Now()
|
||||
sas.Expiry = sas.Start.Add(expire)
|
||||
sas.UseHTTPS = true
|
||||
sas.Identifier = key
|
||||
switch method {
|
||||
case "GET":
|
||||
sas.Read = true
|
||||
@@ -569,7 +568,8 @@ func (self *SContainer) SignUrl(method string, key string, expire time.Duration)
|
||||
default:
|
||||
return "", errors.Error("unsupport method")
|
||||
}
|
||||
return containerRef.GetSASURI(sas)
|
||||
blobRef := containerRef.GetBlobReference(key)
|
||||
return blobRef.GetSASURI(sas)
|
||||
}
|
||||
|
||||
func (self *SContainer) UploadFile(filePath string) (string, error) {
|
||||
|
||||
Reference in New Issue
Block a user