Skip to content

Commit 6e8762f

Browse files
authored
Fix broken webhooks (#29690)
Fix #29689
1 parent 9bf693d commit 6e8762f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

services/webhook/payloader.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ func newJSONRequest[T any](pc payloadConvertor[T], w *webhook_model.Webhook, t *
9494
return nil, nil, err
9595
}
9696

97-
req, err := http.NewRequest(w.HTTPMethod, w.URL, bytes.NewReader(body))
97+
method := w.HTTPMethod
98+
if method == "" {
99+
method = http.MethodPost
100+
}
101+
102+
req, err := http.NewRequest(method, w.URL, bytes.NewReader(body))
98103
if err != nil {
99104
return nil, nil, err
100105
}

0 commit comments

Comments
 (0)