Skip to content

Commit

Permalink
golang#368 NewClient copies all settings from the context client
Browse files Browse the repository at this point in the history
(cherry picked from commit 34851a6)
  • Loading branch information
Ferdy Pruis authored and Camila (ZUP) committed May 24, 2021
1 parent 87783de commit cf5ee2d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,16 @@ func NewClient(ctx context.Context, src TokenSource) *http.Client {
if src == nil {
return internal.ContextClient(ctx)
}

cc := internal.ContextClient(ctx)
return &http.Client{
Transport: &Transport{
Base: internal.ContextClient(ctx).Transport,
Base: cc.Transport,
Source: ReuseTokenSource(nil, src),
},
CheckRedirect: cc.CheckRedirect,
Jar: cc.Jar,
Timeout: cc.Timeout,
}
}

Expand Down

0 comments on commit cf5ee2d

Please sign in to comment.