Allow connection via non https lightning charge node through localhost or 127.0.0.1

This commit is contained in:
nicolas.dorier 2018-03-11 15:14:05 +09:00
parent 3a0a5dbd7f
commit 936ae64ca3

View file

@ -54,10 +54,11 @@ namespace BTCPayServer.Controllers
return View(vm);
}
if (uri.Scheme != "https")
var domain = GetDomain(uri.AbsoluteUri);
if (uri.Scheme != "https" && domain != "127.0.0.1" && domain != "localhost")
{
var internalNode = GetInternalLightningNodeIfAuthorized();
if (internalNode == null || GetDomain(internalNode) != GetDomain(uri.AbsoluteUri))
if (internalNode == null || GetDomain(internalNode) != domain)
{
ModelState.AddModelError(nameof(vm.Url), "The url must be HTTPS");
return View(vm);