mirror of
https://github.com/hacdias/webdav.git
synced 2026-09-26 05:01:54 +08:00
fix: numeric passwords (#24)
License: MIT Signed-off-by: Henrique Dias <[email protected]>
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/hacdias/webdav/webdav"
|
"github.com/hacdias/webdav/webdav"
|
||||||
@@ -81,6 +82,10 @@ func parseUsers(raw []interface{}, c *webdav.Config) {
|
|||||||
password, ok := u["password"].(string)
|
password, ok := u["password"].(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
password = ""
|
password = ""
|
||||||
|
|
||||||
|
if numPwd, ok := u["password"].(int); ok {
|
||||||
|
password = strconv.Itoa(numPwd)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(password, "{env}") {
|
if strings.HasPrefix(password, "{env}") {
|
||||||
|
|||||||
Reference in New Issue
Block a user