aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Startup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Timeline/Startup.cs')
-rw-r--r--Timeline/Startup.cs16
1 files changed, 7 insertions, 9 deletions
diff --git a/Timeline/Startup.cs b/Timeline/Startup.cs
index 6dde227f..2a0f437f 100644
--- a/Timeline/Startup.cs
+++ b/Timeline/Startup.cs
@@ -9,6 +9,7 @@ using Microsoft.IdentityModel.Tokens;
using System.Text;
using Timeline.Configs;
using Timeline.Services;
+using Microsoft.AspNetCore.HttpOverrides;
namespace Timeline
{
@@ -49,6 +50,7 @@ namespace Timeline
});
services.AddSingleton<IUserService, UserService>();
+ services.AddSingleton<IJwtService, JwtService>();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
@@ -61,20 +63,16 @@ namespace Timeline
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();
}
-
- // When not in test environment, use https redirection.
- // Because I found some problems using https redirection in test mode.
- if (!env.IsTest())
- app.UseHttpsRedirection();
-
-
app.UseStaticFiles();
app.UseSpaStaticFiles();
+ app.UseForwardedHeaders(new ForwardedHeadersOptions
+ {
+ ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
+ });
+
app.UseAuthentication();
app.UseMvc(routes =>