mirror of
https://github.com/go-gitea/gitea
synced 2025-07-10 04:27:22 +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:
@ -530,7 +530,9 @@ func Test_WebhookStatus(t *testing.T) {
|
||||
var triggeredEvent string
|
||||
provider := newMockWebhookProvider(func(r *http.Request) {
|
||||
assert.Contains(t, r.Header["X-Github-Event-Type"], "status", "X-GitHub-Event-Type should contain status")
|
||||
assert.Contains(t, r.Header["X-Github-Hook-Installation-Target-Type"], "repository", "X-GitHub-Hook-Installation-Target-Type should contain repository")
|
||||
assert.Contains(t, r.Header["X-Gitea-Event-Type"], "status", "X-Gitea-Event-Type should contain status")
|
||||
assert.Contains(t, r.Header["X-Gitea-Hook-Installation-Target-Type"], "repository", "X-Gitea-Hook-Installation-Target-Type should contain repository")
|
||||
assert.Contains(t, r.Header["X-Gogs-Event-Type"], "status", "X-Gogs-Event-Type should contain status")
|
||||
content, _ := io.ReadAll(r.Body)
|
||||
var payload api.CommitStatusPayload
|
||||
|
Reference in New Issue
Block a user