diff --git a/BTCPayServer/Configuration/BTCPayServerOptions.cs b/BTCPayServer/Configuration/BTCPayServerOptions.cs index c5ecbbfa1..c1d0e75b3 100644 --- a/BTCPayServer/Configuration/BTCPayServerOptions.cs +++ b/BTCPayServer/Configuration/BTCPayServerOptions.cs @@ -141,7 +141,8 @@ namespace BTCPayServer.Configuration .Select(p => (Name: p.p.Substring(0, p.SeparatorIndex), Link: p.p.Substring(p.SeparatorIndex + 1)))) { - OtherExternalServices.AddOrReplace(service.Name, service.Link); + if (Uri.TryCreate(service.Link, UriKind.RelativeOrAbsolute, out var uri)) + OtherExternalServices.AddOrReplace(service.Name, uri); } } @@ -247,7 +248,7 @@ namespace BTCPayServer.Configuration public string RootPath { get; set; } public Dictionary InternalLightningByCryptoCode { get; set; } = new Dictionary(); - public Dictionary OtherExternalServices { get; set; } = new Dictionary(); + public Dictionary OtherExternalServices { get; set; } = new Dictionary(); public ExternalServices ExternalServices { get; set; } = new ExternalServices(); public BTCPayNetworkProvider NetworkProvider { get; set; } diff --git a/BTCPayServer/Controllers/ServerController.cs b/BTCPayServer/Controllers/ServerController.cs index 3fc6d3c2e..fedad696f 100644 --- a/BTCPayServer/Controllers/ServerController.cs +++ b/BTCPayServer/Controllers/ServerController.cs @@ -460,7 +460,7 @@ namespace BTCPayServer.Controllers result.OtherExternalServices.Add(new ServicesViewModel.OtherExternalService() { Name = externalService.Key, - Link = this.Request.GetRelativePathOrAbsolute(externalService.Value) + Link = this.Request.GetAbsoluteUriNoPathBase(externalService.Value).AbsoluteUri }); } if (_Options.SSHSettings != null)