Merge pull request #11 from rmwpl/feature/nexus-compatibility

[feature/nexus-compatibility] Enable Sonatype Nexus compatibility
This commit is contained in:
Roman Vynar 2018-07-04 16:38:06 +03:00 committed by GitHub
commit aaf65ed718
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,7 +69,7 @@ func NewClient(url string, verifyTLS bool, username, password string) *Client {
c.logger.Warn("No token auth service discovered from ", c.url)
return nil
}
} else if strings.HasPrefix(authHeader, "Basic") {
} else if strings.HasPrefix(strings.ToLower(authHeader), strings.ToLower("Basic")) {
c.request = c.request.SetBasicAuth(c.username, c.password)
c.logger.Info("It was discovered the registry is configured with HTTP basic auth.")
}