forked from remote/oauth2
internal: remove RegisterContextClientFunc
This function added a totally unused error path, since the only call site is for App Engine, which cannot produce an error. Change-Id: I86277ab4ff96e7bd140c53c5a114a338716668e3 Reviewed-on: https://go-review.googlesource.com/85935 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
@@ -170,10 +170,6 @@ func providerAuthHeaderWorks(tokenURL string) bool {
|
||||
}
|
||||
|
||||
func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string, v url.Values) (*Token, error) {
|
||||
hc, err := ContextClient(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
bustedAuth := !providerAuthHeaderWorks(tokenURL)
|
||||
if bustedAuth {
|
||||
if clientID != "" {
|
||||
@@ -191,7 +187,7 @@ func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string,
|
||||
if !bustedAuth {
|
||||
req.SetBasicAuth(url.QueryEscape(clientID), url.QueryEscape(clientSecret))
|
||||
}
|
||||
r, err := ctxhttp.Do(ctx, hc, req)
|
||||
r, err := ctxhttp.Do(ctx, ContextClient(ctx), req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user