support forwarding headers
This commit is contained in:
parent
295bbf6bef
commit
47a66ba93a
1 changed files with 8 additions and 0 deletions
|
|
@ -28,6 +28,7 @@ using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using isnd.Data.Catalog;
|
using isnd.Data.Catalog;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Microsoft.AspNetCore.HttpOverrides;
|
||||||
|
|
||||||
namespace isnd
|
namespace isnd
|
||||||
{
|
{
|
||||||
|
|
@ -50,6 +51,12 @@ namespace isnd
|
||||||
var adminStartupListConf = Configuration.GetSection("AdminList");
|
var adminStartupListConf = Configuration.GetSection("AdminList");
|
||||||
var unleashConf = Configuration.GetSection("Unleash");
|
var unleashConf = Configuration.GetSection("Unleash");
|
||||||
|
|
||||||
|
services.Configure<ForwardedHeadersOptions>(options =>
|
||||||
|
{
|
||||||
|
options.ForwardedHeaders =
|
||||||
|
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||||
|
});
|
||||||
|
|
||||||
services.Configure<SmtpSettings>(smtpSettingsconf)
|
services.Configure<SmtpSettings>(smtpSettingsconf)
|
||||||
.Configure<IsndSettings>(isndSettingsconf)
|
.Configure<IsndSettings>(isndSettingsconf)
|
||||||
.Configure<AdminStartupList>(adminStartupListConf)
|
.Configure<AdminStartupList>(adminStartupListConf)
|
||||||
|
|
@ -140,6 +147,7 @@ namespace isnd
|
||||||
ApplicationDbContext dbContext,
|
ApplicationDbContext dbContext,
|
||||||
IOptions<IsndSettings> isnSettingsOption)
|
IOptions<IsndSettings> isnSettingsOption)
|
||||||
{
|
{
|
||||||
|
app.UseForwardedHeaders();
|
||||||
if (env.IsDevelopment())
|
if (env.IsDevelopment())
|
||||||
{
|
{
|
||||||
app.UseDeveloperExceptionPage();
|
app.UseDeveloperExceptionPage();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue