make sure we don't add the slash twice

This commit is contained in:
Ryan McKinley 2018-09-19 10:02:04 -07:00
parent 7c6227c061
commit 7168190f7a

View File

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