Skip to content

Remove the trailing '/' from logged localhost message #63111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 5, 2025

Conversation

DamianEdwards
Copy link
Member

Noticed that when using a URL like myapp.dev.localhost with the new templates, Kestrel logs both the myapp.dev.localhost and localhost addresses, but for the localhost address it includes the trailing slash (due to us using Uri.ToString()). This fixes it so that the slash isn't logged, aligning it with the format of the .localhost address.

@Copilot Copilot AI review requested due to automatic review settings August 4, 2025 20:36
@DamianEdwards DamianEdwards requested a review from halter73 as a code owner August 4, 2025 20:36
@github-actions github-actions bot added the area-hosting Includes Hosting label Aug 4, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a logging inconsistency where localhost URLs were displayed with a trailing slash while .localhost addresses were not. The change ensures consistent URL formatting in Kestrel's address logging by trimming the trailing slash from localhost addresses.

  • Removes trailing slash from localhost address logging to match .localhost address format
  • Improves consistency in logged URL formatting

@DamianEdwards
Copy link
Member Author

@halter73 @BrennanConroy @DeagleGross this is ready for re-review.

@DamianEdwards DamianEdwards merged commit b52c80f into main Aug 5, 2025
30 checks passed
@DamianEdwards DamianEdwards deleted the damianedwards/fix-localhost-log-trailing-slash branch August 5, 2025 23:32
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-rc1 milestone Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-hosting Includes Hosting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants