From 7168190f7a811078e4b7f454cceb2f963d3cc270 Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Wed, 19 Sep 2018 10:02:04 -0700 Subject: [PATCH] make sure we don't add the slash twice --- pkg/api/dataproxy.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/api/dataproxy.go b/pkg/api/dataproxy.go index eb9152e3a73..de86c314832 100644 --- a/pkg/api/dataproxy.go +++ b/pkg/api/dataproxy.go @@ -55,10 +55,11 @@ func (hs *HTTPServer) ProxyDataSourceRequest(c *m.ReqContext) { proxyPath := c.Params("*") - // Check for a trailing slash + // Check for a trailing slash, and pass it to the proxy + // macaron does not include trailing slashes when resolving a wildcard path if len(proxyPath) > 1 { path := c.Req.URL.Path - if path[len(path)-1] == '/' && path[len(path)-2] != '/' { + if path[len(path)-1] == '/' && proxyPath[len(proxyPath)-1] != '/' { proxyPath += "/" } }