diff --git a/api/middleware.go b/api/middleware.go index c350b1c..27202c3 100644 --- a/api/middleware.go +++ b/api/middleware.go @@ -36,6 +36,7 @@ func mwBasicAuth(auther auth.Authenticator) gin.HandlerFunc { } u, p, _ := c.Request.BasicAuth() if _, ok := auther.Authenticate(c, u, p); !ok { + c.Writer.Header().Set("WWW-Authenticate", "Basic") c.AbortWithStatus(http.StatusUnauthorized) } }