diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2021-06-27 21:21:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-27 21:21:09 +0200 |
commit | 9b1b4b543358c212a3da2b480d361d0c1375b279 (patch) | |
tree | 2bb767491b82bde8a76bf8b3148f8b7aaae9167c /routers/api/v1/utils/hook.go | |
parent | Make allowed Visiblity modes configurable for Users (#16271) (diff) | |
download | forgejo-9b1b4b543358c212a3da2b480d361d0c1375b279.tar.xz forgejo-9b1b4b543358c212a3da2b480d361d0c1375b279.zip |
Refactor Webhook + Add X-Hub-Signature (#16176)
This PR removes multiple unneeded fields from the `HookTask` struct and adds the two headers `X-Hub-Signature` and `X-Hub-Signature-256`.
## :warning: BREAKING :warning:
* The `Secret` field is no longer passed as part of the payload.
* "Breaking" change (or fix?): The webhook history shows the real called url and not the url registered in the webhook (`deliver.go`@129).
Close #16115
Fixes #7788
Fixes #11755
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'routers/api/v1/utils/hook.go')
-rw-r--r-- | routers/api/v1/utils/hook.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/utils/hook.go b/routers/api/v1/utils/hook.go index c7af40dcf0..5f2be65a29 100644 --- a/routers/api/v1/utils/hook.go +++ b/routers/api/v1/utils/hook.go @@ -133,7 +133,7 @@ func addHook(ctx *context.APIContext, form *api.CreateHookOption, orgID, repoID BranchFilter: form.BranchFilter, }, IsActive: form.Active, - Type: models.HookTaskType(form.Type), + Type: models.HookType(form.Type), } if w.Type == models.SLACK { channel, ok := form.Config["channel"] |