Skip to content

Commit 9795208

Browse files
author
jojoliang
committed
update auth
1 parent 100cdb8 commit 9795208

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

auth.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,10 @@ func (t *AuthorizationTransport) GetCredential() (string, string, string) {
302302
// RoundTrip implements the RoundTripper interface.
303303
func (t *AuthorizationTransport) RoundTrip(req *http.Request) (*http.Response, error) {
304304
req = cloneRequest(req) // per RoundTrip contract
305-
if t.Expire == time.Duration(0) {
306-
t.Expire = defaultAuthExpire
307-
}
308305

309306
ak, sk, token := t.GetCredential()
310307
// 增加 Authorization header
311-
authTime := NewAuthTime(t.Expire)
308+
authTime := NewAuthTime(defaultAuthExpire)
312309
AddAuthorizationHeader(ak, sk, token, req, authTime)
313310

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

0 commit comments

Comments
 (0)