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 += "/" } }