Updated the Startup.cs to forward headers, hopefully this will help with making sure remote IPs are correctly retrieved.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.IO;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
//using Microsoft.Extensions.Configuration.Binder;
|
||||
|
||||
namespace SecureCore
|
||||
{
|
||||
public static class AppSettingsManager
|
||||
{
|
||||
public static bool TryGetConnectionStringByName(string connectionStringName, out string connectionString)
|
||||
{
|
||||
connectionString = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
// You could either use this
|
||||
var builder = new ConfigurationBuilder()
|
||||
.SetBasePath(Directory.GetCurrentDirectory())
|
||||
.AddJsonFile("appsettings.json")
|
||||
.Build();
|
||||
|
||||
connectionString = builder.GetConnectionString(connectionStringName);
|
||||
|
||||
if (!string.IsNullOrEmpty(connectionString)) return true;
|
||||
else return false;
|
||||
}
|
||||
catch { return false; }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user