diff --git a/Program.cs b/Program.cs index 7dd7a9b..b0bf2b3 100644 --- a/Program.cs +++ b/Program.cs @@ -20,7 +20,7 @@ namespace NikolaNet Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { - webBuilder.UseStartup().UseUrls("http://0.0.0.0:5000"); + webBuilder.UseStartup()); }); } } diff --git a/Startup.cs b/Startup.cs index 3dec5ef..1efe698 100644 --- a/Startup.cs +++ b/Startup.cs @@ -1,5 +1,4 @@ using System; -using System.Net; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -9,7 +8,6 @@ using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Microsoft.AspNetCore.HttpOverrides; namespace NikolaNet { @@ -26,15 +24,6 @@ namespace NikolaNet public void ConfigureServices(IServiceCollection services) { services.AddRazorPages(); - services.Configure(options => - { - options.ForwardedHeaders = - ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto; - }); - services.Configure(options => -{ - options.KnownProxies.Add(IPAddress.Parse("192.168.1.102")); -}); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -43,20 +32,12 @@ namespace NikolaNet if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); - 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(new ForwardedHeadersOptions - { - ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto - }); } app.UseHttpsRedirection();