Skip to content

Commit

Permalink
update auth
Browse files Browse the repository at this point in the history
  • Loading branch information
jojoliang committed Jul 27, 2021
1 parent 100cdb8 commit 9795208
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,10 @@ func (t *AuthorizationTransport) GetCredential() (string, string, string) {
// RoundTrip implements the RoundTripper interface.
func (t *AuthorizationTransport) RoundTrip(req *http.Request) (*http.Response, error) {
req = cloneRequest(req) // per RoundTrip contract
if t.Expire == time.Duration(0) {
t.Expire = defaultAuthExpire
}

ak, sk, token := t.GetCredential()
// 增加 Authorization header
authTime := NewAuthTime(t.Expire)
authTime := NewAuthTime(defaultAuthExpire)
AddAuthorizationHeader(ak, sk, token, req, authTime)

resp, err := t.transport().RoundTrip(req)
Expand Down

0 comments on commit 9795208

Please sign in to comment.