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

pull/726/head
Jim 6 years ago committed by GitHub
parent 49daf1b016
commit b8c527c6cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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, "/")

Loading…
Cancel
Save