1
0
Fork 0
forked from forgejo/forgejo

[BUG] Packagist webhook: support all events

Fixes #2329
This commit is contained in:
oliverpool 2024-03-13 09:26:56 +01:00
parent 226fa396df
commit a47a1e0777
3 changed files with 59 additions and 268 deletions

View file

@ -88,7 +88,10 @@ func newJSONRequest[T any](pc payloadConvertor[T], w *webhook_model.Webhook, t *
if err != nil {
return nil, nil, err
}
return newJSONRequestWithPayload(payload, w, t, withDefaultHeaders)
}
func newJSONRequestWithPayload(payload any, w *webhook_model.Webhook, t *webhook_model.HookTask, withDefaultHeaders bool) (*http.Request, []byte, error) {
body, err := json.MarshalIndent(payload, "", " ")
if err != nil {
return nil, nil, err