Browse Source

add the trailing slash

Ryan McKinley 7 years ago
parent
commit
bc68aa99b2
1 changed files with 9 additions and 0 deletions
  1. 9 0
      pkg/api/dataproxy.go

+ 9 - 0
pkg/api/dataproxy.go

@@ -54,6 +54,15 @@ func (hs *HTTPServer) ProxyDataSourceRequest(c *m.ReqContext) {
 	}
 
 	proxyPath := c.Params("*")
+
+	// Check for a trailing slash
+	if len(proxyPath) > 1 {
+		path := c.Req.URL.Path
+		if path[len(path)-1] == '/' && path[len(path)-2] != '/' {
+			proxyPath += "/"
+		}
+	}
+
 	proxy := pluginproxy.NewDataSourceProxy(ds, plugin, c, proxyPath)
 	proxy.HandleRequest()
 }