From 8e8ba3d052b42711f6f094e642f95c004c60fdfc Mon Sep 17 00:00:00 2001 From: d11n Date: Tue, 14 Feb 2023 14:37:35 +0100 Subject: [PATCH] Webhook: Add missing model validation (#4636) Fixes #4628. --- BTCPayServer/Controllers/UIStoresController.Integrations.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BTCPayServer/Controllers/UIStoresController.Integrations.cs b/BTCPayServer/Controllers/UIStoresController.Integrations.cs index 4d97024a5..b3338847c 100644 --- a/BTCPayServer/Controllers/UIStoresController.Integrations.cs +++ b/BTCPayServer/Controllers/UIStoresController.Integrations.cs @@ -118,6 +118,8 @@ namespace BTCPayServer.Controllers var webhook = await _Repo.GetWebhook(CurrentStore.Id, webhookId); if (webhook is null) return NotFound(); + if (!ModelState.IsValid) + return View(nameof(ModifyWebhook), viewModel); await _Repo.UpdateWebhook(CurrentStore.Id, webhookId, viewModel.CreateBlob()); TempData[WellKnownTempData.SuccessMessage] = "The webhook has been updated";