add header for basic auth
This commit is contained in:
		| @ -36,6 +36,7 @@ func mwBasicAuth(auther auth.Authenticator) gin.HandlerFunc { | |||||||
| 		} | 		} | ||||||
| 		u, p, _ := c.Request.BasicAuth() | 		u, p, _ := c.Request.BasicAuth() | ||||||
| 		if _, ok := auther.Authenticate(c, u, p); !ok { | 		if _, ok := auther.Authenticate(c, u, p); !ok { | ||||||
|  | 			c.Writer.Header().Set("WWW-Authenticate", "Basic") | ||||||
| 			c.AbortWithStatus(http.StatusUnauthorized) | 			c.AbortWithStatus(http.StatusUnauthorized) | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user