Tell clients to authenticate with basic auth

This commit is contained in:
Daniel Bornkessel 2013-01-09 13:59:50 +01:00
parent 872a959b31
commit 0f7fe643f0
1 changed files with 2 additions and 1 deletions

View File

@ -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)
}
})
}