From 54a735ffd994066a06c712cdad767d41a01d287d Mon Sep 17 00:00:00 2001 From: d11n Date: Fri, 21 Jan 2022 03:11:08 +0100 Subject: [PATCH] Pay Button: Fix CSP violations for custom amount and slider (#3334) Fixes #3241. --- BTCPayServer/Views/UIStores/PayButton.cshtml | 98 +++++++-- BTCPayServer/wwwroot/paybutton/paybutton.js | 201 +++++++++---------- 2 files changed, 173 insertions(+), 126 deletions(-) diff --git a/BTCPayServer/Views/UIStores/PayButton.cshtml b/BTCPayServer/Views/UIStores/PayButton.cshtml index f17f3f2c4..8eb3a2179 100644 --- a/BTCPayServer/Views/UIStores/PayButton.cshtml +++ b/BTCPayServer/Views/UIStores/PayButton.cshtml @@ -3,6 +3,11 @@ @{ ViewData.SetActivePage(StoreNavPages.PayButton, "Pay Button", Context.GetStoreData().Id); csp.AllowUnsafeHashes("onBTCPayFormSubmit(event);return false"); + csp.AllowUnsafeHashes("handleSliderChange(event);return false"); + csp.AllowUnsafeHashes("handleSliderInput(event);return false"); + csp.AllowUnsafeHashes("handlePriceSlider(event);return false"); + csp.AllowUnsafeHashes("handlePriceInput(event);return false"); + csp.AllowUnsafeHashes("handlePlusMinus(event);return false"); } @section PageHeadContent { @@ -15,24 +20,75 @@ -