Fix http basic auth if protocol is missing (#22)

Basic auth only worked if a full url was supplied.  The reason is that
BasicTransport.RoundTrip checked if the resulting request URL has a the
transport's URL as a prefix.

This is fixed by setting the transport's URL to the canonical URL that is
computed a few lines earlier.
This commit is contained in:
Hynek Schlawack 2017-04-18 19:32:28 +02:00 committed by Jess Frazelle
parent f87e406a2e
commit 11a291f744

View file

@ -68,7 +68,7 @@ func newFromTransport(auth types.AuthConfig, transport http.RoundTripper, debug
}
basicAuthTransport := &BasicTransport{
Transport: tokenTransport,
URL: auth.ServerAddress,
URL: url,
Username: auth.Username,
Password: auth.Password,
}