Skip to content

Commit 61b8021

Browse files
committed
fix(odps/account/sts_account.go): 正确设置STS token头
1 parent c5d243b commit 61b8021

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

odps/account/sts_account.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ func (sp *stsAliyunCredentialProvider) _signRequest(req *http.Request, endpoint
7777
if err != nil {
7878
return err
7979
}
80-
81-
req.Header.Set(common.HttpHeaderAuthorizationSTSToken, *cred.BearerToken)
82-
80+
if cred.SecurityToken != nil {
81+
req.Header.Set(common.HttpHeaderAuthorizationSTSToken, *cred.SecurityToken)
82+
}
8383
return nil
8484
}
8585

0 commit comments

Comments
 (0)