mirror of
https://github.com/grafana/grafana.git
synced 2025-07-29 03:12:27 +08:00
(cloudwatch) fix, don't block by white list (#5632)
This commit is contained in:

committed by
Torkel Ödegaard

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