summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/auth/auth.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/auth/auth.go b/pkg/auth/auth.go
index 3ecdd99fe..8e4cb6959 100644
--- a/pkg/auth/auth.go
+++ b/pkg/auth/auth.go
@@ -33,7 +33,10 @@ const XRegistryConfigHeader HeaderAuthName = "X-Registry-Config"
// GetCredentials queries the http.Request for X-Registry-.* headers and extracts
// the necessary authentication information for libpod operations
func GetCredentials(r *http.Request) (*types.DockerAuthConfig, string, error) {
- has := func(key HeaderAuthName) bool { hdr, found := r.Header[string(key)]; return found && len(hdr) > 0 }
+ has := func(key HeaderAuthName) bool {
+ hdr, found := r.Header[key.String()]
+ return found && len(hdr) > 0
+ }
switch {
case has(XRegistryConfigHeader):
c, f, err := getConfigCredentials(r)