diff --git a/server/server.go b/server/server.go index 9d7f44e5a..6fe3cea36 100644 --- a/server/server.go +++ b/server/server.go @@ -540,6 +540,6 @@ func clientUsage(values client.Values) *client.Usage { } func validBasepath(basepath string) bool { - re := regexp.MustCompile(`(\/{1}\w+)+`) + re := regexp.MustCompile(`(\/{1}[\w-]+)+`) return re.ReplaceAllLiteralString(basepath, "") == "" } diff --git a/server/server_test.go b/server/server_test.go index f6dd40c42..9a8591cde 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -43,6 +43,13 @@ func Test_validBasepath(t *testing.T) { }, want: true, }, + { + name: "Basepath can include numbers, hyphens, and underscores", + args: args{ + basepath: "/3shishka-bob/-rus4s_rus-1_s-", + }, + want: true, + }, { name: "Basepath is not empty and invalid - no slashes", args: args{