Skip to content

fix: allow localhost in chat.agent.allowedNetworkDomains#317732

Open
thonhaus wants to merge 2 commits into
microsoft:mainfrom
thonhaus:networkfilter
Open

fix: allow localhost in chat.agent.allowedNetworkDomains#317732
thonhaus wants to merge 2 commits into
microsoft:mainfrom
thonhaus:networkfilter

Conversation

@thonhaus
Copy link
Copy Markdown

Fixes #314339

Copilot AI review requested due to automatic review settings May 21, 2026 08:57
@thonhaus
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copy link
Copy Markdown
Contributor

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 an issue in the agent network domain filtering logic where localhost (and other non–well-known-suffix hosts such as loopback IPs) could not be matched by chat.agent.allowedNetworkDomains when specified as a bare pattern, causing requests to be blocked even when explicitly allowlisted.

Changes:

  • Adjusted domain-pattern normalization so allow/deny patterns are not subject to the “well-known TLD / file-extension” heuristic filtering.
  • Added unit tests to ensure localhost patterns match correctly and that localhost can be allowed/denied via configuration.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/vs/platform/networkFilter/common/domainMatcher.ts Ensures allow/deny patterns are normalized in a way that supports localhost and similar explicit patterns.
src/vs/platform/networkFilter/test/common/domainMatcher.test.ts Adds coverage for localhost matching and allow/deny behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

localhost is always blocked when chat.agent.networkFilter is enabled

3 participants