Explorar el Código

Merge branch 'master' of github.com:grafana/grafana

Torkel Ödegaard hace 9 años
padre
commit
b943e41434
Se han modificado 2 ficheros con 11 adiciones y 10 borrados
  1. 1 1
      docs/sources/http_api/dashboard.md
  2. 10 9
      pkg/api/dataproxy.go

+ 1 - 1
docs/sources/http_api/dashboard.md

@@ -96,7 +96,7 @@ Will return the dashboard given the dashboard slug. Slug is the url friendly ver
         "isStarred": false,
         "slug": "production-overview"
       },
-      "model": {
+      "dashboard": {
         "id": null,
         "title": "Production Overview",
         "tags": [ "templated" ],

+ 10 - 9
pkg/api/dataproxy.go

@@ -90,6 +90,11 @@ func ProxyDataSourceRequest(c *middleware.Context) {
 		return
 	}
 
+	if ds.Type == m.DS_CLOUDWATCH {
+		cloudwatch.HandleRequest(c, ds)
+		return
+	}
+
 	targetUrl, _ := url.Parse(ds.Url)
 	if len(setting.DataProxyWhiteList) > 0 {
 		if _, exists := setting.DataProxyWhiteList[targetUrl.Host]; !exists {
@@ -98,13 +103,9 @@ func ProxyDataSourceRequest(c *middleware.Context) {
 		}
 	}
 
-	if ds.Type == m.DS_CLOUDWATCH {
-		cloudwatch.HandleRequest(c, ds)
-	} else {
-		proxyPath := c.Params("*")
-		proxy := NewReverseProxy(ds, proxyPath, targetUrl)
-		proxy.Transport = dataProxyTransport
-		proxy.ServeHTTP(c.Resp, c.Req.Request)
-		c.Resp.Header().Del("Set-Cookie")
-	}
+	proxyPath := c.Params("*")
+	proxy := NewReverseProxy(ds, proxyPath, targetUrl)
+	proxy.Transport = dataProxyTransport
+	proxy.ServeHTTP(c.Resp, c.Req.Request)
+	c.Resp.Header().Del("Set-Cookie")
 }