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 isnd.Data.Catalog;
|
||||
using Newtonsoft.Json;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
|
||||
namespace isnd
|
||||
{
|
||||
|
|
@ -50,6 +51,12 @@ namespace isnd
|
|||
var adminStartupListConf = Configuration.GetSection("AdminList");
|
||||
var unleashConf = Configuration.GetSection("Unleash");
|
||||
|
||||
services.Configure<ForwardedHeadersOptions>(options =>
|
||||
{
|
||||
options.ForwardedHeaders =
|
||||
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||
});
|
||||
|
||||
services.Configure<SmtpSettings>(smtpSettingsconf)
|
||||
.Configure<IsndSettings>(isndSettingsconf)
|
||||
.Configure<AdminStartupList>(adminStartupListConf)
|
||||
|
|
@ -140,6 +147,7 @@ namespace isnd
|
|||
ApplicationDbContext dbContext,
|
||||
IOptions<IsndSettings> isnSettingsOption)
|
||||
{
|
||||
app.UseForwardedHeaders();
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue