1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-07 02:57:20 +00:00

Webhook add X-Gitea-Hook-Installation-Target-Type Header (#33752)

This is a X-GitHub Header port

* repository for repository webhooks (matches GitHub)
* organization for organization webhooks (matches GitHub)
* user for user webhooks (Gitea specific)
* system for system webhooks  (Gitea specific)
* default for default hooks needs testing (Gitea specific)

- `X-Gitea-Hook-Installation-Target-Type`
- `X-GitHub-Hook-Installation-Target-Type`
This commit is contained in:
ChristopherHX
2025-03-01 07:50:49 +01:00
committed by GitHub
parent 698ae7aa5b
commit b684f51d20
4 changed files with 25 additions and 4 deletions

View File

@ -107,7 +107,7 @@ func newJSONRequest[T any](pc payloadConvertor[T], w *webhook_model.Webhook, t *
req.Header.Set("Content-Type", "application/json")
if withDefaultHeaders {
return req, body, addDefaultHeaders(req, []byte(w.Secret), t, body)
return req, body, addDefaultHeaders(req, []byte(w.Secret), w, t, body)
}
return req, body, nil
}