fix: numeric passwords (#24)

License: MIT
Signed-off-by: Henrique Dias <[email protected]>
This commit is contained in:
Henrique Dias
2019-06-09 13:51:53 +01:00
committed by GitHub
parent d266f1150e
commit 764a69cd33
+5
View File
@@ -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}") {