Skip to content

Commit cf5ee2d

Browse files
Ferdy PruisCamila (ZUP)
Ferdy Pruis
authored and
Camila (ZUP)
committed
golang#368 NewClient copies all settings from the context client
(cherry picked from commit 34851a6)
1 parent 87783de commit cf5ee2d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: oauth2.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,16 @@ func NewClient(ctx context.Context, src TokenSource) *http.Client {
343343
if src == nil {
344344
return internal.ContextClient(ctx)
345345
}
346+
347+
cc := internal.ContextClient(ctx)
346348
return &http.Client{
347349
Transport: &Transport{
348-
Base: internal.ContextClient(ctx).Transport,
350+
Base: cc.Transport,
349351
Source: ReuseTokenSource(nil, src),
350352
},
353+
CheckRedirect: cc.CheckRedirect,
354+
Jar: cc.Jar,
355+
Timeout: cc.Timeout,
351356
}
352357
}
353358

0 commit comments

Comments
 (0)