mirror of
https://github.com/distribution/distribution.git
synced 2025-09-01 23:17:33 +00:00
Merge pull request #2711 from davidswu/autoredirect
add autoredirect auth config
This commit is contained in:
@@ -847,7 +847,7 @@ func (app *App) authorized(w http.ResponseWriter, r *http.Request, context *Cont
|
||||
switch err := err.(type) {
|
||||
case auth.Challenge:
|
||||
// Add the appropriate WWW-Auth header
|
||||
err.SetHeaders(w)
|
||||
err.SetHeaders(r, w)
|
||||
|
||||
if err := errcode.ServeJSON(w, errcode.ErrorCodeUnauthorized.WithDetail(accessRecords)); err != nil {
|
||||
dcontext.GetLogger(context).Errorf("error serving error json: %v (from %v)", err, context.Errors)
|
||||
|
Reference in New Issue
Block a user