From bf6014644401dd3fdf9031670b3a00ccd866f49f Mon Sep 17 00:00:00 2001 From: S7evinK Date: Fri, 31 Jul 2020 00:04:19 +0200 Subject: 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 * Rename getTxnID -> getMatrixTxnID * Use local variable instead of constant value Co-authored-by: techknowlogick --- routers/repo/webhook.go | 1 + 1 file changed, 1 insertion(+) (limited to 'routers') 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, -- cgit v1.2.3