diff options
Diffstat (limited to 'plumbing/transport/http')
-rw-r--r-- | plumbing/transport/http/common.go | 10 | ||||
-rw-r--r-- | plumbing/transport/http/common_test.go | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/plumbing/transport/http/common.go b/plumbing/transport/http/common.go index 5d3535e..16ff930 100644 --- a/plumbing/transport/http/common.go +++ b/plumbing/transport/http/common.go @@ -84,7 +84,7 @@ var DefaultClient = NewClient(nil) // Unless a properly initialized client is given, it will fall back into // `http.DefaultClient`. // -// Note that for HTTP client cannot distinguist between private repositories and +// Note that for HTTP client cannot distinguish between private repositories and // unexistent repositories on GitHub. So it returns `ErrAuthorizationRequired` // for both. func NewClient(c *http.Client) transport.Transport { @@ -139,7 +139,7 @@ func (s *session) ApplyAuthToRequest(req *http.Request) { return } - s.auth.setAuth(req) + s.auth.SetAuth(req) } func (s *session) ModifyEndpointIfRedirect(res *http.Response) { @@ -175,7 +175,7 @@ func (*session) Close() error { // AuthMethod is concrete implementation of common.AuthMethod for HTTP services type AuthMethod interface { transport.AuthMethod - setAuth(r *http.Request) + SetAuth(r *http.Request) } func basicAuthFromEndpoint(ep *transport.Endpoint) *BasicAuth { @@ -192,7 +192,7 @@ type BasicAuth struct { Username, Password string } -func (a *BasicAuth) setAuth(r *http.Request) { +func (a *BasicAuth) SetAuth(r *http.Request) { if a == nil { return } @@ -226,7 +226,7 @@ type TokenAuth struct { Token string } -func (a *TokenAuth) setAuth(r *http.Request) { +func (a *TokenAuth) SetAuth(r *http.Request) { if a == nil { return } diff --git a/plumbing/transport/http/common_test.go b/plumbing/transport/http/common_test.go index 8b300e8..d9e0636 100644 --- a/plumbing/transport/http/common_test.go +++ b/plumbing/transport/http/common_test.go @@ -64,7 +64,7 @@ func (s *ClientSuite) TestNewTokenAuth(c *C) { // Check header is set correctly req, err := http.NewRequest("GET", "https://github.com/git-fixtures/basic", nil) c.Assert(err, Equals, nil) - a.setAuth(req) + a.SetAuth(req) c.Assert(req.Header.Get("Authorization"), Equals, "Bearer OAUTH-TOKEN-TEXT") } |