From f7ec671a7422ea1fc6de4bb310fed3b4933f27e9 Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 15 Jun 2020 00:05:02 +0800 Subject: refactor(back): Use generic host. --- Timeline/Startup.cs | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'Timeline/Startup.cs') diff --git a/Timeline/Startup.cs b/Timeline/Startup.cs index a5eab4ad..2eb08f96 100644 --- a/Timeline/Startup.cs +++ b/Timeline/Startup.cs @@ -1,7 +1,6 @@ using AutoMapper; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.HttpOverrides; using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; @@ -118,21 +117,6 @@ namespace Timeline // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app) { - if (string.Equals(System.Environment.GetEnvironmentVariable("ASPNETCORE_FORWARDEDHEADERS_ENABLED"), "true", StringComparison.OrdinalIgnoreCase)) - { - var options = new ForwardedHeadersOptions - { - ForwardedHeaders = ForwardedHeaders.XForwardedFor | - ForwardedHeaders.XForwardedProto - }; - // Only loopback proxies are allowed by default. - // Clear that restriction because forwarders are enabled by explicit - // configuration. - options.KnownNetworks.Clear(); - options.KnownProxies.Clear(); - app.UseForwardedHeaders(options); - } - app.UseRouting(); if (!disableFrontEnd && (useMockFrontEnd || !Environment.IsDevelopment())) -- cgit v1.2.3