Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(396)

Unified Diff: google/google.go

Issue 104700043: oauth2: avoid using http.DefaultTransport
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« google/appengine.go ('K') | « google/appenginevm.go ('k') | jwt.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google/google.go
diff --git a/google/google.go b/google/google.go
index fec36de445d535ddd25179029849072033d3b933..f83d24609005301f1e32db1740060c7a3384ce9a 100644
--- a/google/google.go
+++ b/google/google.go
@@ -61,7 +61,7 @@ func NewComputeEngineConfig(account string) *ComputeEngineConfig {
// NewTransport creates an authorized transport.
func (c *ComputeEngineConfig) NewTransport() oauth2.Transport {
- return oauth2.NewAuthorizedTransport(c, nil)
+ return oauth2.NewAuthorizedTransport(http.DefaultTransport, c, nil)
}
// FetchToken retrieves a new access token via metadata server.
@@ -76,7 +76,7 @@ func (c *ComputeEngineConfig) FetchToken(existing *oauth2.Token) (token *oauth2.
return
}
req.Header.Add("X-Google-Metadata-Request", "True")
- resp, err := (&http.Client{Transport: oauth2.DefaultTransport}).Do(req)
+ resp, err := http.DefaultClient.Do(req)
if err != nil {
return
}
« google/appengine.go ('K') | « google/appenginevm.go ('k') | jwt.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b