diff --git a/src/website/admin.go b/src/website/admin.go index 1f96fdf..c69c1b8 100644 --- a/src/website/admin.go +++ b/src/website/admin.go @@ -40,10 +40,13 @@ func AdminAtomFeed(c *RequestContext) ResponseData { creds := fmt.Sprintf("%s:%s", config.Config.Admin.AtomUsername, config.Config.Admin.AtomPassword) expectedAuth := fmt.Sprintf("Basic %s", base64.StdEncoding.EncodeToString([]byte(creds))) auth, hasAuth := c.Req.Header["Authorization"] - if hasAuth { - c.Logger.Warn().Str("auth", auth[0]).Msg("Got auth") - } - if !hasAuth || auth[0] != expectedAuth { + if !hasAuth { + res := ResponseData{ + StatusCode: http.StatusUnauthorized, + } + res.Header().Set("WWW-Authenticate", "Basic realm=\"Admin\"") + return res + } else if auth[0] != expectedAuth { return FourOhFour(c) }