From c2d34422d65e81eee6e9d0c31a4c5a446fa9678a Mon Sep 17 00:00:00 2001 From: Ashley Nelson Date: Thu, 25 Jun 2020 06:27:09 -0500 Subject: [PATCH] Remove trailing slash in client api proxy (#1163) Signed-off-by: Ashley Nelson --- cmd/client-api-proxy/main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/client-api-proxy/main.go b/cmd/client-api-proxy/main.go index 979b0b042..ebc0629f8 100644 --- a/cmd/client-api-proxy/main.go +++ b/cmd/client-api-proxy/main.go @@ -58,9 +58,8 @@ var ( ) func makeProxy(targetURL string) (*httputil.ReverseProxy, error) { - if !strings.HasSuffix(targetURL, "/") { - targetURL += "/" - } + targetURL = strings.TrimSuffix(targetURL, "/") + // Check that we can parse the URL. _, err := url.Parse(targetURL) if err != nil {