oauth2: don't use http.DefaultTransport.

http.DefaultTransport is not available on App Engine.
This commit is contained in:
Burcu Dogan
2014-07-11 10:57:28 -07:00
parent 958c47866e
commit 0f597d5ad4
8 changed files with 37 additions and 27 deletions

View File

@@ -3,6 +3,7 @@
package google
import (
"net/http"
"strings"
"github.com/golang/oauth2"
@@ -25,7 +26,7 @@ func NewAppEngineConfig(context appengine.Context, scopes []string) *AppEngineCo
// NewTransport returns a transport that authorizes
// the requests with the application's service account.
func (c *AppEngineConfig) NewTransport() oauth2.Transport {
return oauth2.NewAuthorizedTransport(c, nil)
return oauth2.NewAuthorizedTransport(http.DefaultTransport, c, nil)
}
// FetchToken fetches a new access token for the provided scopes.