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
+12
View File
@@ -67,6 +67,18 @@ type DataSource struct {
Updated time.Time `json:"updated"`
}
// AllowedCookies parses the jsondata.keepCookies and returns a list of
// allowed cookies, otherwise an empty list.
func (ds DataSource) AllowedCookies() []string {
if ds.JsonData != nil {
if keepCookies := ds.JsonData.Get("keepCookies"); keepCookies != nil {
return keepCookies.MustStringArray()
}
}
return []string{}
}
// ----------------------
// COMMANDS