Skip to content

Conversation

@timheuer
Copy link
Member

Fixes #256611

  • πŸ” Added TLD matching for localhost variations
  • βœ… Updated tests to cover new localhost cases

The solution follows RFC 6761 standards where .localhost is a special-use top-level domain reserved for loopback purposes. The regex pattern ^(.+.)?localhost(:\d+)?$ matches:

localhost (the base domain)
*.localhost (any subdomain of localhost)
Optional port numbers (e.g., :3000, :8080)
Case-insensitive matching

Now when you encounter links ending with dev.localhost or any other *.localhost subdomain, VS Code will automatically trust them and won't prompt you to configure trusted domains or ask if you want to open the external website. This provides the same seamless experience as localhost itself, which aligns with the RFC 6761 specification that treats the entire .localhost TLD as reserved for local loopback testing.

- πŸ” Added TLD matching for localhost variations
- βœ… Updated tests to cover new localhost cases
lramos15
lramos15 previously approved these changes Jul 18, 2025
@vs-code-engineering vs-code-engineering bot added this to the July 2025 milestone Jul 18, 2025
rzhao271
rzhao271 previously approved these changes Jul 18, 2025
@timheuer timheuer dismissed stale reviews from rzhao271 and lramos15 via 914937e July 21, 2025 14:47
@lramos15 lramos15 merged commit 9e37f46 into microsoft:main Jul 21, 2025
17 checks passed
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VS Code treats *.localhost addresses as external websites

6 participants