From 361aa94fae20a9249c467f89d856700ae0403507 Mon Sep 17 00:00:00 2001 From: Damian Edwards Date: Mon, 4 Aug 2025 13:33:12 -0700 Subject: [PATCH 1/3] Remove the trailing '/' from logged localhost message --- src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs b/src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs index 98ada6d90eb5..6dcecd3d50a5 100644 --- a/src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs +++ b/src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs @@ -171,7 +171,7 @@ static string ExpandPorts(string ports, string scheme) if (address.Contains(".localhost", StringComparison.OrdinalIgnoreCase) && Uri.TryCreate(address, UriKind.Absolute, out var uri) && uri.Host.EndsWith(".localhost", StringComparison.OrdinalIgnoreCase)) { // Log the localhost address without the sub-domain prefix too - Log.ListeningOnAddress(LifetimeLogger, new UriBuilder(uri) { Host = "localhost" }.ToString()); + Log.ListeningOnAddress(LifetimeLogger, new UriBuilder(uri) { Host = "localhost" }.ToString().TrimEnd('/')); } } } From de2456106eacdf80304b7cc843d13d0e56e98ab7 Mon Sep 17 00:00:00 2001 From: Damian Edwards Date: Mon, 4 Aug 2025 13:37:54 -0700 Subject: [PATCH 2/3] Update src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs b/src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs index 6dcecd3d50a5..05d6aeabe186 100644 --- a/src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs +++ b/src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs @@ -171,7 +171,7 @@ static string ExpandPorts(string ports, string scheme) if (address.Contains(".localhost", StringComparison.OrdinalIgnoreCase) && Uri.TryCreate(address, UriKind.Absolute, out var uri) && uri.Host.EndsWith(".localhost", StringComparison.OrdinalIgnoreCase)) { // Log the localhost address without the sub-domain prefix too - Log.ListeningOnAddress(LifetimeLogger, new UriBuilder(uri) { Host = "localhost" }.ToString().TrimEnd('/')); + Log.ListeningOnAddress(LifetimeLogger, new UriBuilder(uri) { Host = "localhost" }.Uri.GetLeftPart(UriPartial.Authority)); } } } From 350bd7750427334c51dc9ca287a45c38a634b507 Mon Sep 17 00:00:00 2001 From: Damian Edwards Date: Tue, 5 Aug 2025 10:51:08 -0700 Subject: [PATCH 3/3] Revert "Update src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs" This reverts commit de2456106eacdf80304b7cc843d13d0e56e98ab7. --- src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs b/src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs index 05d6aeabe186..6dcecd3d50a5 100644 --- a/src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs +++ b/src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs @@ -171,7 +171,7 @@ static string ExpandPorts(string ports, string scheme) if (address.Contains(".localhost", StringComparison.OrdinalIgnoreCase) && Uri.TryCreate(address, UriKind.Absolute, out var uri) && uri.Host.EndsWith(".localhost", StringComparison.OrdinalIgnoreCase)) { // Log the localhost address without the sub-domain prefix too - Log.ListeningOnAddress(LifetimeLogger, new UriBuilder(uri) { Host = "localhost" }.Uri.GetLeftPart(UriPartial.Authority)); + Log.ListeningOnAddress(LifetimeLogger, new UriBuilder(uri) { Host = "localhost" }.ToString().TrimEnd('/')); } } }