From cd2820e165483609fbe0af99455bf909e6a8cd30 Mon Sep 17 00:00:00 2001 From: Ganesh Vernekar Date: Fri, 30 Mar 2018 11:00:22 +0530 Subject: [PATCH] Fix pathPrefix bug from PR-4025 --- web/web.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/web.go b/web/web.go index eae7fa94d6..731850cd99 100644 --- a/web/web.go +++ b/web/web.go @@ -666,7 +666,13 @@ func tmplFuncs(consolesPath string, opts *Options) template_text.FuncMap { return time.Since(t) / time.Millisecond * time.Millisecond }, "consolesPath": func() string { return consolesPath }, - "pathPrefix": func() string { return opts.RoutePrefix }, + "pathPrefix": func() string { + if opts.RoutePrefix == "/" { + return "" + } else { + return opts.RoutePrefix + } + }, "buildVersion": func() string { return opts.Version.Revision }, "stripLabels": func(lset map[string]string, labels ...string) map[string]string { for _, ln := range labels {