From fddbf73a57dd5cf980d2eb32e025591a8e0e33cc Mon Sep 17 00:00:00 2001 From: Ted Reed Date: Fri, 6 Nov 2015 17:10:28 -0800 Subject: [PATCH] De-obfuscate error message Previously, this error message would stringify as a pointer address, which isn't particularly helpful. This change breaks out the elements of the challenge object such that the error is appropriately represented. Signed-off-by: Ted Reed --- registry/auth/htpasswd/access.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/auth/htpasswd/access.go b/registry/auth/htpasswd/access.go index 5ac3d84a7..82d3556dc 100644 --- a/registry/auth/htpasswd/access.go +++ b/registry/auth/htpasswd/access.go @@ -94,7 +94,7 @@ func (ch challenge) SetHeaders(w http.ResponseWriter) { } func (ch challenge) Error() string { - return fmt.Sprintf("basic authentication challenge: %#v", ch) + return fmt.Sprintf("basic authentication challenge for realm %q: %s", ch.realm, ch.err) } func init() {