optimize: encrypted-password support

This commit is contained in:
XZB-1248
2022-10-15 20:37:43 +08:00
parent c511f839bc
commit 4d879121ba

View File

@@ -37,7 +37,7 @@ func BasicAuth(accounts map[string]string, realm string) gin.HandlerFunc {
if len(realm) == 0 {
realm = `Authorization Required`
}
reg := regexp.MustCompile(`^\$([a-zA-Z0-9]+)\$([a-zA-Z0-9]+)$`)
reg := regexp.MustCompile(`^\$([a-zA-Z0-9]+)\$(.*)$`)
stdAccounts := make(map[string]cipher)
for user, pass := range accounts {
if match := reg.FindStringSubmatch(pass); len(match) > 0 {