Skip to content

Commit

Permalink
Fix broken webhooks (#29690)
Browse files Browse the repository at this point in the history
Fix #29689
  • Loading branch information
lunny authored Mar 10, 2024
1 parent 9bf693d commit 6e8762f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion services/webhook/payloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ func newJSONRequest[T any](pc payloadConvertor[T], w *webhook_model.Webhook, t *
return nil, nil, err
}

req, err := http.NewRequest(w.HTTPMethod, w.URL, bytes.NewReader(body))
method := w.HTTPMethod
if method == "" {
method = http.MethodPost
}

req, err := http.NewRequest(method, w.URL, bytes.NewReader(body))
if err != nil {
return nil, nil, err
}
Expand Down

0 comments on commit 6e8762f

Please sign in to comment.