forked from mirror/client_golang
Merge pull request #6 from kesselborn/basic-auth-fix
Tell clients to authenticate with basic auth
This commit is contained in:
commit
e9b12f3921
|
@ -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