Tell clients to authenticate with basic auth
This commit is contained in:
parent
872a959b31
commit
0f7fe643f0
|
@ -139,7 +139,8 @@ func (register *Registry) YieldBasicAuthExporter(username, password string) http
|
||||||
if authenticated {
|
if authenticated {
|
||||||
exporter.ServeHTTP(w, r)
|
exporter.ServeHTTP(w, r)
|
||||||
} else {
|
} else {
|
||||||
http.Error(w, "access forbidden", 403)
|
w.Header().Add("WWW-Authenticate", "Basic")
|
||||||
|
http.Error(w, "access forbidden", 401)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue