Fix: If reverse proxy wasn't well configured, and error message should have been displayed (#4322)

This commit is contained in:
Nicolas Dorier
2022-11-22 03:32:19 +09:00
committed by GitHub
parent 20025f254c
commit bf597495ff
5 changed files with 35 additions and 36 deletions

View File

@@ -67,7 +67,7 @@ namespace BTCPayServer.Controllers
[HttpGet]
public async Task<IActionResult> AddApiKey()
{
if (!_btcPayServerEnvironment.IsSecure)
if (!_btcPayServerEnvironment.IsSecure(HttpContext))
{
TempData.SetStatusMessageModel(new StatusMessageModel()
{
@@ -84,7 +84,7 @@ namespace BTCPayServer.Controllers
public async Task<IActionResult> AuthorizeAPIKey(string[] permissions, string applicationName = null, Uri redirect = null,
bool strict = true, bool selectiveStores = false, string applicationIdentifier = null)
{
if (!_btcPayServerEnvironment.IsSecure)
if (!_btcPayServerEnvironment.IsSecure(HttpContext))
{
TempData.SetStatusMessageModel(new StatusMessageModel
{