From 5d867bff7f200a45127af85d6978d21017d41ebb Mon Sep 17 00:00:00 2001 From: Sawood Alam Date: Mon, 30 May 2016 00:05:22 -0400 Subject: [PATCH] Improved trailing slash trimming, #80 --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 3219fc5..ddce40e 100644 --- a/main.go +++ b/main.go @@ -724,10 +724,12 @@ func overrideFlags() { } else { baseURL = fmt.Sprintf("http://%s:%d%s", *host, *port, *root) } + baseURL = strings.TrimRight(baseURL, "/") if *proxy == "http://{HOST}[:{PORT}]{ROOT}" { *proxy = baseURL + } else { + *proxy = strings.TrimRight(*proxy, "/") } - *proxy = strings.TrimRight(*proxy, "/") } func serviceInfo() (msg string) {