From 2946e83493e2628c68819357ebc15bada38d45b5 Mon Sep 17 00:00:00 2001 From: Miloslav Trmač Date: Sat, 11 Sep 2021 22:37:23 +0200 Subject: Beautify GetCredentials.has a bit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use separate lines, and use the provided .String() API. Should not change behaivor. Signed-off-by: Miloslav Trmač --- pkg/auth/auth.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pkg/auth') 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) -- cgit v1.2.3-54-g00ecf