From 056cb60d5d6401800bcd7b756e6d9c2a7fc61a48 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Thu, 25 Jul 2019 20:54:49 +0900 Subject: [PATCH] Validate dynamic dns POST --- BTCPayServer/Controllers/ServerController.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BTCPayServer/Controllers/ServerController.cs b/BTCPayServer/Controllers/ServerController.cs index 9e23e0696..6ca54f006 100644 --- a/BTCPayServer/Controllers/ServerController.cs +++ b/BTCPayServer/Controllers/ServerController.cs @@ -871,6 +871,10 @@ namespace BTCPayServer.Controllers [HttpPost] public async Task DynamicDnsService(DynamicDnsViewModel viewModel, string hostname, string command = null) { + if (!ModelState.IsValid) + { + return View(viewModel); + } var settings = (await _SettingsRepository.GetSettingAsync()) ?? new DynamicDnsSettings(); var i = settings.Services.FindIndex(d => d.Hostname.Equals(hostname, StringComparison.OrdinalIgnoreCase));