mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
(feature) add LINE notify to notifier
This commit is contained in:
@@ -19,6 +19,7 @@ type Webhook struct {
|
||||
Password string
|
||||
Body string
|
||||
HttpMethod string
|
||||
HttpHeader map[string]string
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -63,6 +64,12 @@ func sendWebRequestSync(ctx context.Context, webhook *Webhook) error {
|
||||
request.Header.Add("Authorization", util.GetBasicAuthHeader(webhook.User, webhook.Password))
|
||||
}
|
||||
|
||||
if len(webhook.HttpHeader) != 0 {
|
||||
for k, v := range webhook.HttpHeader {
|
||||
request.Header.Set(k, v)
|
||||
}
|
||||
}
|
||||
|
||||
resp, err := ctxhttp.Do(ctx, http.DefaultClient, request)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user