|
|
|
@ -8,6 +8,7 @@ using Microsoft.AspNetCore.HttpsPolicy;
@@ -8,6 +8,7 @@ using Microsoft.AspNetCore.HttpsPolicy;
|
|
|
|
|
using Microsoft.Extensions.Configuration; |
|
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
|
using Microsoft.Extensions.Hosting; |
|
|
|
|
using Microsoft.AspNetCore.HttpOverrides; |
|
|
|
|
|
|
|
|
|
namespace NikolaNet |
|
|
|
|
{ |
|
|
|
@ -37,14 +38,20 @@ namespace NikolaNet
@@ -37,14 +38,20 @@ namespace NikolaNet
|
|
|
|
|
if (env.IsDevelopment()) |
|
|
|
|
{ |
|
|
|
|
app.UseDeveloperExceptionPage(); |
|
|
|
|
app.UseForwardedHeaders(); |
|
|
|
|
app.UseForwardedHeaders(new ForwardedHeadersOptions |
|
|
|
|
{ |
|
|
|
|
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
app.UseExceptionHandler("/Error"); |
|
|
|
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
|
|
|
|
app.UseHsts(); |
|
|
|
|
app.UseForwardedHeaders(); |
|
|
|
|
app.UseForwardedHeaders(new ForwardedHeadersOptions |
|
|
|
|
{ |
|
|
|
|
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
app.UseHttpsRedirection(); |
|
|
|
|