Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
leotsarev authored May 1, 2021
1 parent fe08125 commit 9f6b718
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/JoinRpg.Portal/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Localization;
using Microsoft.AspNetCore.Mvc;
Expand Down Expand Up @@ -103,6 +104,12 @@ public void ConfigureServices(IServiceCollection services)
.AddAuthentication()
.ConfigureJoinExternalLogins(Configuration.GetSection("Authentication"));

services.Configure<ForwardedHeadersOptions>(options =>
{
options.ForwardedHeaders =
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
});

_ = services.AddSwaggerGen(Swagger.ConfigureSwagger);
_ = services.AddApplicationInsightsTelemetry();

Expand Down Expand Up @@ -157,9 +164,12 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
}
});

_ = app.UseForwardedHeaders();

_ = app
.UseSwagger(Swagger.Configure)
.UseSwaggerUI(Swagger.ConfigureUI);

_ = app.UseSwagger(Swagger.Configure);
_ = app.UseSwaggerUI(Swagger.ConfigureUI);
if (!env.IsDevelopment())
{
_ = app.UseHttpsRedirection();
Expand Down

0 comments on commit 9f6b718

Please sign in to comment.