Skip to content

Commit 8bad8e9

Browse files
author
Ferdy Pruis
committed
golang#368 NewClient copies all settings from the context client
1 parent 9fd6049 commit 8bad8e9

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)