diff --git a/CHANGELOG.md b/CHANGELOG.md index c87e20bc1..f7bb38de6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ 1. [#3527](https://github.com/influxdata/chronograf/pull/3527): Ensure cell queries use constraints from TimeSelector 1. [#3573](https://github.com/influxdata/chronograf/pull/3573): Fix Gauge color selection bug 1. [#3649](https://github.com/influxdata/chronograf/pull/3649): Fix erroneous icons in Date Picker widget +1. [#3697](https://github.com/influxdata/chronograf/pull/3697): Fix allowing hyphens in basepath ## v1.5.0.0 [2018-05-15-RC] 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{