forked from gitea/gitea
Add specific event type to header (#17222)
* Add specific event type to header Signed-off-by: jolheiser <john.olheiser@gmail.com> * Change single to type
This commit is contained in:
parent
20eaca6d05
commit
760d61b411
|
@ -113,16 +113,21 @@ func Deliver(t *models.HookTask) error {
|
||||||
signatureSHA256 = hex.EncodeToString(sig256.Sum(nil))
|
signatureSHA256 = hex.EncodeToString(sig256.Sum(nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
event := t.EventType.Event()
|
||||||
|
eventType := string(t.EventType)
|
||||||
req.Header.Add("X-Gitea-Delivery", t.UUID)
|
req.Header.Add("X-Gitea-Delivery", t.UUID)
|
||||||
req.Header.Add("X-Gitea-Event", t.EventType.Event())
|
req.Header.Add("X-Gitea-Event", event)
|
||||||
|
req.Header.Add("X-Gitea-Event-Type", eventType)
|
||||||
req.Header.Add("X-Gitea-Signature", signatureSHA256)
|
req.Header.Add("X-Gitea-Signature", signatureSHA256)
|
||||||
req.Header.Add("X-Gogs-Delivery", t.UUID)
|
req.Header.Add("X-Gogs-Delivery", t.UUID)
|
||||||
req.Header.Add("X-Gogs-Event", t.EventType.Event())
|
req.Header.Add("X-Gogs-Event", event)
|
||||||
|
req.Header.Add("X-Gogs-Event-Type", eventType)
|
||||||
req.Header.Add("X-Gogs-Signature", signatureSHA256)
|
req.Header.Add("X-Gogs-Signature", signatureSHA256)
|
||||||
req.Header.Add("X-Hub-Signature", "sha1="+signatureSHA1)
|
req.Header.Add("X-Hub-Signature", "sha1="+signatureSHA1)
|
||||||
req.Header.Add("X-Hub-Signature-256", "sha256="+signatureSHA256)
|
req.Header.Add("X-Hub-Signature-256", "sha256="+signatureSHA256)
|
||||||
req.Header["X-GitHub-Delivery"] = []string{t.UUID}
|
req.Header["X-GitHub-Delivery"] = []string{t.UUID}
|
||||||
req.Header["X-GitHub-Event"] = []string{t.EventType.Event()}
|
req.Header["X-GitHub-Event"] = []string{event}
|
||||||
|
req.Header["X-GitHub-Event-Type"] = []string{eventType}
|
||||||
|
|
||||||
// Record delivery information.
|
// Record delivery information.
|
||||||
t.RequestInfo = &models.HookRequest{
|
t.RequestInfo = &models.HookRequest{
|
||||||
|
|
Loading…
Reference in New Issue