From 0f7fe643f03f4ae5cb2dc5aba6482e72b022e22e Mon Sep 17 00:00:00 2001 From: Daniel Bornkessel Date: Wed, 9 Jan 2013 13:59:50 +0100 Subject: [PATCH] Tell clients to authenticate with basic auth --- registry.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/registry.go b/registry.go index 806b1ee..a3c617c 100644 --- a/registry.go +++ b/registry.go @@ -139,7 +139,8 @@ func (register *Registry) YieldBasicAuthExporter(username, password string) http if authenticated { exporter.ServeHTTP(w, r) } else { - http.Error(w, "access forbidden", 403) + w.Header().Add("WWW-Authenticate", "Basic") + http.Error(w, "access forbidden", 401) } }) }