Skip to content

Commit de24561

Browse files
Update src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs
Co-authored-by: Copilot <[email protected]>
1 parent 361aa94 commit de24561

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Hosting/Hosting/src/GenericHost/GenericWebHostService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ static string ExpandPorts(string ports, string scheme)
171171
if (address.Contains(".localhost", StringComparison.OrdinalIgnoreCase) && Uri.TryCreate(address, UriKind.Absolute, out var uri) && uri.Host.EndsWith(".localhost", StringComparison.OrdinalIgnoreCase))
172172
{
173173
// Log the localhost address without the sub-domain prefix too
174-
Log.ListeningOnAddress(LifetimeLogger, new UriBuilder(uri) { Host = "localhost" }.ToString().TrimEnd('/'));
174+
Log.ListeningOnAddress(LifetimeLogger, new UriBuilder(uri) { Host = "localhost" }.Uri.GetLeftPart(UriPartial.Authority));
175175
}
176176
}
177177
}

0 commit comments

Comments
 (0)