diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/InvoiceController.UI.cs index ce0a682d8..a18c441e3 100644 --- a/BTCPayServer/Controllers/InvoiceController.UI.cs +++ b/BTCPayServer/Controllers/InvoiceController.UI.cs @@ -273,6 +273,7 @@ namespace BTCPayServer.Controllers var model = new PaymentModel() { CryptoCode = network.CryptoCode, + RootPath = this.Request.PathBase.Value.WithTrailingSlash(), PaymentMethodId = paymentMethodId.ToString(), PaymentMethodName = GetDisplayName(paymentMethodId, network), CryptoImage = GetImage(paymentMethodId, network), @@ -345,9 +346,8 @@ namespace BTCPayServer.Controllers private string GetImage(PaymentMethodId paymentMethodId, BTCPayNetwork network) { - var res = paymentMethodId.PaymentType == PaymentTypes.BTCLike ? - Url.Content(network.CryptoImagePath) : Url.Content(network.LightningImagePath); - return "/" + res; + return paymentMethodId.PaymentType == PaymentTypes.BTCLike ? + this.Request.GetRelativePathOrAbsolute(network.CryptoImagePath) : this.Request.GetRelativePathOrAbsolute(network.LightningImagePath); } private string OrderAmountFromInvoice(string cryptoCode, ProductInformation productInformation) diff --git a/BTCPayServer/Models/InvoicingModels/PaymentModel.cs b/BTCPayServer/Models/InvoicingModels/PaymentModel.cs index 68135486a..e2493c338 100644 --- a/BTCPayServer/Models/InvoicingModels/PaymentModel.cs +++ b/BTCPayServer/Models/InvoicingModels/PaymentModel.cs @@ -64,5 +64,6 @@ namespace BTCPayServer.Models.InvoicingModels public bool CoinSwitchEnabled { get; set; } public string CoinSwitchMode { get; set; } public string CoinSwitchMerchantId { get; set; } + public string RootPath { get; set; } } } diff --git a/BTCPayServer/Views/Invoice/Checkout.cshtml b/BTCPayServer/Views/Invoice/Checkout.cshtml index 18d1b2065..587f877f9 100644 --- a/BTCPayServer/Views/Invoice/Checkout.cshtml +++ b/BTCPayServer/Views/Invoice/Checkout.cshtml @@ -126,7 +126,7 @@ .use(window.i18nextXHRBackend) .init({ backend: { - loadPath: '/locales/{{lng}}.json' + loadPath: '@(Model.RootPath)locales/{{lng}}.json' }, lng: startingLanguage, fallbackLng: fallbackLanguage,