Merge pull request #3697 from influxdata/fix/basepath_hyphens
Fix allowing hyphens in basepathpull/3698/head^2
commit
7571bfe9f6
|
@ -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]
|
||||
|
||||
|
|
|
@ -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, "") == ""
|
||||
}
|
||||
|
|
|
@ -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{
|
||||
|
|
Loading…
Reference in New Issue