Plugins: Support headers field for check health (#49930)

This commit is contained in:
Marcus Efraimsson
2022-05-31 17:58:06 +02:00
committed by GitHub
parent a91ecc566b
commit a7813275a5
9 changed files with 55 additions and 20 deletions
+1 -8
View File
@@ -222,14 +222,7 @@ func (proxy *DataSourceProxy) director(req *http.Request) {
applyUserHeader(proxy.cfg.SendUserHeader, req, proxy.ctx.SignedInUser)
keepCookieNames := []string{}
if proxy.ds.JsonData != nil {
if keepCookies := proxy.ds.JsonData.Get("keepCookies"); keepCookies != nil {
keepCookieNames = keepCookies.MustStringArray()
}
}
proxyutil.ClearCookieHeader(req, keepCookieNames)
proxyutil.ClearCookieHeader(req, proxy.ds.AllowedCookies())
req.Header.Set("User-Agent", fmt.Sprintf("Grafana/%s", setting.BuildVersion))
jsonData := make(map[string]interface{})