From b8c527c6cda63c37e96de6cd4c8fbdb9fe87b7e1 Mon Sep 17 00:00:00 2001 From: Jim Date: Sat, 17 Oct 2020 19:01:24 -0400 Subject: [PATCH] handle v1 as a prefix/suffix, not just a cut set to be trimmed (#723) --- api/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/client.go b/api/client.go index 6131b3be26..11ad3b2878 100644 --- a/api/client.go +++ b/api/client.go @@ -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, "/")