aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/http/common.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-05-04 10:17:15 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2017-05-04 10:17:15 +0200
commitb8b61e74469e0d2662e7d690eee14893f91fe259 (patch)
tree1933fe53200d98ad2c557d034609408641ce2900 /plumbing/transport/http/common.go
parent40fa5882a2c73f8c075403b7ec85870f04deda07 (diff)
parente80cdbabb92a1ec35ffad536f52d3ff04b548fd1 (diff)
downloadgo-git-b8b61e74469e0d2662e7d690eee14893f91fe259.tar.gz
Merge branch 'master' of github.com:src-d/go-git into commit
Diffstat (limited to 'plumbing/transport/http/common.go')
-rw-r--r--plumbing/transport/http/common.go12
1 files changed, 3 insertions, 9 deletions
diff --git a/plumbing/transport/http/common.go b/plumbing/transport/http/common.go
index 930e8eb..04b6121 100644
--- a/plumbing/transport/http/common.go
+++ b/plumbing/transport/http/common.go
@@ -73,18 +73,12 @@ type AuthMethod interface {
}
func basicAuthFromEndpoint(ep transport.Endpoint) *BasicAuth {
- info := ep.User
- if info == nil {
+ u := ep.User()
+ if u == "" {
return nil
}
- p, ok := info.Password()
- if !ok {
- return nil
- }
-
- u := info.Username()
- return NewBasicAuth(u, p)
+ return NewBasicAuth(u, ep.Password())
}
// BasicAuth represent a HTTP basic auth