Skip to content

Commit 187b7a4

Browse files
authored
Merge pull request #299 from tencentyun/feature_jojoliang_d5e3d4a4
将x-cos-security-token签入到签名
2 parents a9d70c2 + a05da06 commit 187b7a4

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

auth.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,12 @@ func AddAuthorizationHeader(secretID, secretKey string, sessionToken string, req
219219
if secretID == "" {
220220
return
221221
}
222-
223-
auth := newAuthorization(secretID, secretKey, req,
224-
authTime, true,
225-
)
226222
if len(sessionToken) > 0 {
227223
req.Header.Set("x-cos-security-token", sessionToken)
228224
}
225+
auth := newAuthorization(secretID, secretKey, req,
226+
authTime, true,
227+
)
229228
req.Header.Set("Authorization", auth)
230229
}
231230

cos.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626

2727
const (
2828
// Version current go sdk version
29-
Version = "0.7.61"
29+
Version = "0.7.62"
3030
UserAgent = "cos-go-sdk-v5/" + Version
3131
contentTypeXML = "application/xml"
3232
defaultServiceBaseURL = "http://service.cos.myqcloud.com"

0 commit comments

Comments
 (0)