Fix error pages
This commit is contained in:
parent
0674d906ee
commit
65431da22c
|
@ -7,6 +7,7 @@ using KamihamaWeb.Services;
|
|||
using KamihamaWeb.Util;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using Microsoft.AspNetCore.HttpsPolicy;
|
||||
using Microsoft.AspNetCore.ResponseCompression;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
@ -96,14 +97,19 @@ namespace KamihamaWeb
|
|||
}
|
||||
else
|
||||
{
|
||||
app.UseForwardedHeaders(new ForwardedHeadersOptions
|
||||
{
|
||||
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
|
||||
});
|
||||
app.UseExceptionHandler("/Home/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.UseHsts();
|
||||
}
|
||||
|
||||
app.UseHttpCacheHeaders();
|
||||
app.UseHttpsRedirection();
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseStatusCodePagesWithReExecute("/Error/{0}");
|
||||
app.UseRouting();
|
||||
app.UseResponseCompression();
|
||||
app.UseAuthorization();
|
||||
|
|
Loading…
Reference in New Issue