Skip to content

Commit a05da06

Browse files
author
jojoliang
committed
将x-cos-security-token签入到签名
1 parent c05b99d commit a05da06

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)