From dcffa13cfa623043b22542a59d2ec9a7949874a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Thu, 30 Nov 2023 23:02:09 +0100 Subject: [PATCH] Return the application builder after applying proxy hosting --- .../Extensions/ApplicationBuilderExtensions.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AMWD.Common.AspNetCore/Extensions/ApplicationBuilderExtensions.cs b/AMWD.Common.AspNetCore/Extensions/ApplicationBuilderExtensions.cs index ab8426e..df7cd78 100644 --- a/AMWD.Common.AspNetCore/Extensions/ApplicationBuilderExtensions.cs +++ b/AMWD.Common.AspNetCore/Extensions/ApplicationBuilderExtensions.cs @@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.Builder /// The application builder. /// The where proxy requests are received from (optional). /// The where proxy requests are received from (optional). - public static void UseProxyHosting(this IApplicationBuilder app, IPNetwork network = null, IPAddress address = null) + public static IApplicationBuilder UseProxyHosting(this IApplicationBuilder app, IPNetwork network = null, IPAddress address = null) { string path = Environment.GetEnvironmentVariable("ASPNETCORE_APPL_PATH"); if (!string.IsNullOrWhiteSpace(path)) @@ -64,6 +64,8 @@ namespace Microsoft.AspNetCore.Builder options.KnownProxies.Add(address); app.UseForwardedHeaders(options); + + return app; } } }