diff options
author | S7evinK <tfaelligen@gmail.com> | 2020-07-31 00:04:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-30 18:04:19 -0400 |
commit | bf6014644401dd3fdf9031670b3a00ccd866f49f (patch) | |
tree | d9e62ccb8f385aca9207c33e6a8484f9ee5ef170 /routers/repo/webhook.go | |
parent | f6d5303e022a1d11bdf16279bb82aabd7c48427e (diff) | |
download | gitea-bf6014644401dd3fdf9031670b3a00ccd866f49f.tar.gz gitea-bf6014644401dd3fdf9031670b3a00ccd866f49f.zip |
Don't use legacy method to send Matrix Webhook (#12348)
* Don't use legacy send for messages
* Add migrations to ensure Matrix webhooks use PUT
* Set HTTP method to PUT as default
* Fix sql condition..
Signed-off-by: Till Faelligen <tfaelligen@gmail.com>
* Rename getTxnID -> getMatrixTxnID
* Use local variable instead of constant value
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'routers/repo/webhook.go')
-rw-r--r-- | routers/repo/webhook.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/routers/repo/webhook.go b/routers/repo/webhook.go index 7ac403b462..bec401021c 100644 --- a/routers/repo/webhook.go +++ b/routers/repo/webhook.go @@ -454,6 +454,7 @@ func MatrixHooksNewPost(ctx *context.Context, form auth.NewMatrixHookForm) { RepoID: orCtx.RepoID, URL: fmt.Sprintf("%s/_matrix/client/r0/rooms/%s/send/m.room.message", form.HomeserverURL, form.RoomID), ContentType: models.ContentTypeJSON, + HTTPMethod: "PUT", HookEvent: ParseHookEvent(form.WebhookForm), IsActive: form.Active, HookTaskType: models.MATRIX, |