From 490ea18638f1bfb5aa728171f46bfdc39784dfc8 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Fri, 22 Jul 2016 20:15:18 +0900 Subject: [PATCH 1/2] (cloudwatch) fix, don't block by white list (#5632) --- pkg/api/dataproxy.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pkg/api/dataproxy.go b/pkg/api/dataproxy.go index 871212adc6f..b4860fcb1fb 100644 --- a/pkg/api/dataproxy.go +++ b/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") } From 62e162c44ca6ed44c8b0353233b6322923901ec2 Mon Sep 17 00:00:00 2001 From: Peter Bonney Date: Sat, 23 Jul 2016 05:46:20 -0400 Subject: [PATCH 2/2] Update dashboard.md (#5640) The key returned by `GET /api/dashboards/db/:slug` is "dashboard" (not "model"). --- docs/sources/http_api/dashboard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/http_api/dashboard.md b/docs/sources/http_api/dashboard.md index ead63c722aa..d62a8a967f4 100644 --- a/docs/sources/http_api/dashboard.md +++ b/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" ],