oauth2: remove direct dependency on golang.org/x/net

Change-Id: If8fd952f4bfd3bac3e85592a49616adf4b43ce51
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/460764
Reviewed-by: Cody Oss <codyoss@google.com>
Run-TryBot: Matt Hickford <matt.hickford@gmail.com>
Reviewed-by: Matt Hickford <matt.hickford@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Eric Chiang 2023-01-06 15:23:03 -08:00 committed by Cody Oss
parent 34ffb07a99
commit e07593a4c4
2 changed files with 2 additions and 4 deletions

2
go.mod
View File

@ -5,11 +5,11 @@ go 1.17
require (
cloud.google.com/go/compute/metadata v0.2.0
github.com/google/go-cmp v0.5.8
golang.org/x/net v0.5.0
google.golang.org/appengine v1.6.7
)
require (
github.com/golang/protobuf v1.5.2 // indirect
golang.org/x/net v0.5.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
)

View File

@ -19,8 +19,6 @@ import (
"strings"
"sync"
"time"
"golang.org/x/net/context/ctxhttp"
)
// Token represents the credentials used to authorize
@ -229,7 +227,7 @@ func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string,
}
func doTokenRoundTrip(ctx context.Context, req *http.Request) (*Token, error) {
r, err := ctxhttp.Do(ctx, ContextClient(ctx), req)
r, err := ContextClient(ctx).Do(req.WithContext(ctx))
if err != nil {
return nil, err
}