diff --git a/BTCPayServer/Controllers/ManageController.APIKeys.cs b/BTCPayServer/Controllers/ManageController.APIKeys.cs index 23052fe9b..9db9e31f7 100644 --- a/BTCPayServer/Controllers/ManageController.APIKeys.cs +++ b/BTCPayServer/Controllers/ManageController.APIKeys.cs @@ -40,10 +40,10 @@ namespace BTCPayServer.Controllers } return View("Confirm", new ConfirmModel() { - Title = "Delete API Key "+ ( string.IsNullOrEmpty(key.Label)? string.Empty: key.Label) + "("+key.Id+")", + Title = "Delete API Key " + (string.IsNullOrEmpty(key.Label) ? string.Empty : key.Label) + "(" + key.Id + ")", Description = "Any application using this api key will immediately lose access", Action = "Delete", - ActionUrl = Request.GetCurrentUrl().Replace("RemoveAPIKey", "RemoveAPIKeyPost") + ActionUrl = this.Url.ActionLink(nameof(RemoveAPIKeyPost), values: new { id = id }) }); } @@ -247,7 +247,7 @@ namespace BTCPayServer.Controllers { var key = new APIKeyData() { - Id = Guid.NewGuid().ToString().Replace("-", string.Empty), + Id = Guid.NewGuid().ToString().Replace("-", string.Empty, StringComparison.OrdinalIgnoreCase), Type = APIKeyType.Permanent, UserId = _userManager.GetUserId(User), Label = viewModel.Label