handle v1 as a prefix/suffix, not just a cut set to be trimmed (#723)

This commit is contained in:
Jim authored and GitHub committed 2020-10-17 19:01:24 -04:00
1 parent 49daf1b016
commit b8c527c6cd
1 file changed
+2 -1
+2 -1
View File
@@ -239,7 +239,8 @@ func (c *Config) setAddr(addr string) error {
// Remove v1 in front or back (e.g. they could have
// https://boundary.example.com/myinstall/v1 which would put it at the
// back)
path = strings.Trim(path, "v1")
path = strings.TrimPrefix(path, "v1")
path = strings.TrimSuffix(path, "v1")
// Finally check again to make sure any slashes are removed before we join
// below
path = strings.Trim(path, "/")