Skip to content

http-client: support CIDR in no_proxy - #2495

Open
silverwind wants to merge 3 commits into
actions:mainfrom
silverwind:no-proxy-cidr
Open

silverwind wants to merge 3 commits into
actions:mainfrom
silverwind:no-proxy-cidr

Conversation

@silverwind

@silverwind silverwind commented Sep 15, 2026

Copy link
Copy Markdown

Support CIDR syntax in the no_proxy parsing of http-client.

The best "spec" on this topic is https://about.gitlab.com/blog/we-need-to-talk-no-proxy/ which shows the go and ruby parsers and probably others support CIDR in no_proxy and I have a specific use case where this broke when having 10.0.0.0/8 inside no_proxy.

Created with assistance of Claude Opus 5 and GPT 6 Astra.

Entries like 10.0.0.0/8 were compared as plain strings, so requests to IP
hosts in such ranges went through the proxy even though curl, Go and most
other clients bypass it.

Co-Authored-By: Claude (Opus 5) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 15, 2026 12:15
@silverwind
silverwind requested a review from a team as a code owner September 15, 2026 12:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Reject malformed CIDR entries containing extra path components.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds IPv4 and IPv6 CIDR support to no_proxy handling in the HTTP client.

Changes:

  • Uses Node’s BlockList for CIDR matching.
  • Adds tests for valid and invalid CIDR entries.
File summaries
File Description
packages/http-client/src/proxy.ts Implements CIDR-based proxy bypass matching.
packages/http-client/__tests__/proxy.test.ts Tests IPv4/IPv6 CIDR behavior.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/http-client/src/proxy.ts Outdated
An entry like 10.0.0.0/8/x was matched as 10.0.0.0/8.

Co-Authored-By: Claude (Opus 5) <noreply@anthropic.com>
Comment thread packages/http-client/__tests__/proxy.test.ts Outdated
@silverwind silverwind changed the title http-client: support CIDR ranges in no_proxy http-client: support CIDR in no_proxy Sep 16, 2026
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.

2 participants