|
@@ -37,6 +37,9 @@ func (s *Service) ServiceConfig() *registrytypes.ServiceConfig {
|
|
// It can be used to verify the validity of a client's credentials.
|
|
// It can be used to verify the validity of a client's credentials.
|
|
func (s *Service) Auth(authConfig *types.AuthConfig, userAgent string) (status, token string, err error) {
|
|
func (s *Service) Auth(authConfig *types.AuthConfig, userAgent string) (status, token string, err error) {
|
|
serverAddress := authConfig.ServerAddress
|
|
serverAddress := authConfig.ServerAddress
|
|
|
|
+ if serverAddress == "" {
|
|
|
|
+ serverAddress = IndexServer
|
|
|
|
+ }
|
|
if !strings.HasPrefix(serverAddress, "https://") && !strings.HasPrefix(serverAddress, "http://") {
|
|
if !strings.HasPrefix(serverAddress, "https://") && !strings.HasPrefix(serverAddress, "http://") {
|
|
serverAddress = "https://" + serverAddress
|
|
serverAddress = "https://" + serverAddress
|
|
}
|
|
}
|