Chore: Use Header.Set method instead of Header.Add (#29804)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-12-14 15:13:01 +01:00
committed by GitHub
parent ebb8b4286b
commit ac09baae7d
11 changed files with 30 additions and 28 deletions

View File

@ -61,11 +61,11 @@ func (ns *NotificationService) sendWebRequestSync(ctx context.Context, webhook *
webhook.ContentType = "application/json"
}
request.Header.Add("Content-Type", webhook.ContentType)
request.Header.Add("User-Agent", "Grafana")
request.Header.Set("Content-Type", webhook.ContentType)
request.Header.Set("User-Agent", "Grafana")
if webhook.User != "" && webhook.Password != "" {
request.Header.Add("Authorization", util.GetBasicAuthHeader(webhook.User, webhook.Password))
request.Header.Set("Authorization", util.GetBasicAuthHeader(webhook.User, webhook.Password))
}
for k, v := range webhook.HttpHeader {