mirror of
https://github.com/grafana/grafana.git
synced 2024-11-22 08:56:43 -06:00
Security: Fixes minor security issue with alert notification webhooks that allowed GET & DELETE requests #29330
This commit is contained in:
parent
0fc8426bf1
commit
d796c61946
@ -48,6 +48,10 @@ func (ns *NotificationService) sendWebRequestSync(ctx context.Context, webhook *
|
||||
webhook.HttpMethod = http.MethodPost
|
||||
}
|
||||
|
||||
if webhook.HttpMethod != http.MethodPost && webhook.HttpMethod != http.MethodPut {
|
||||
return fmt.Errorf("webhook only supports HTTP methods PUT or POST")
|
||||
}
|
||||
|
||||
request, err := http.NewRequest(webhook.HttpMethod, webhook.Url, bytes.NewReader([]byte(webhook.Body)))
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user