GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(env-http-proxy-agent): NO_PROXY wildcard semantics by mcollina · Pull Request #5777 · nodejs/undici

Conversation

@mcollina

@mcollina mcollina commented Sep 5, 2026

Copy link
Copy Markdown
Member

Fix NO_PROXY wildcard matching in EnvHttpProxyAgent so fetch() is internally consistent with node:http (see nodejs/node#57872, the NO_PROXY differences table).

Three non-sensible behaviors are fixed:

  • *.example.com previously bypassed the proxy for the apex example.com itself. A *.domain entry is a subdomain wildcard and must only match sub.example.com / a.b.example.com, not the apex. node:http already does this.
  • * (a wildcard with surrounding whitespace) was not recognized as a global wildcard because the check compared the whole NO_PROXY string against *.
  • none.invalid,* (a * among other entries) was likewise not recognized as a global wildcard.

A bare * entry now matches all hosts regardless of position or whitespace, and is port-aware (*:80 only bypasses that port).

Tests updated and added; all env-http-proxy-agent tests pass and lint is clean.

Refs: nodejs/node#57872

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mcollina
fix(env-http-proxy-agent): NO_PROXY wildcard semantics
5aff5bc
Make `*.domain` NO_PROXY entries match subdomains only, not the apex
host (align with node:http and the usual wildcard convention), and
recognize a bare '*' entry as a global wildcard regardless of its
position or surrounding whitespace (e.g. ' * ' or 'none.invalid,*').
Previously these bypassed the proxy incorrectly or not at all.

Refs: nodejs/node#57872
@codecov-commenter

codecov-commenter commented Sep 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.47619% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.51%. Comparing base (17117f6) to head (5aff5bc).
⚠️ Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
lib/dispatcher/env-http-proxy-agent.js 90.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5777      +/-   ##
==========================================
+ Coverage   93.50%   93.51%   +0.01%     
==========================================
  Files         110      110              
  Lines       39072    39374     +302     
==========================================
+ Hits        36534    36821     +287     
- Misses       2538     2553      +15     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

inoway46
inoway46 reviewed Sep 6, 2026
View reviewed changes
Comment thread lib/dispatcher/env-http-proxy-agent.js
Comment on lines +103 to +108
if (entry.hostname === '*') {
if (entry.port && entry.port !== port) {
continue
}
return false // Never proxy if a wildcard entry is present.
}

@inoway46 inoway46 Sep 6, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I noticed this also introduces *:PORT behavior, while node:http currently only treats an exact * entry as a global wildcard.

Is that difference intentional given the goal of keeping the two implementations consistent?

If *:PORT is intended here, it might also be worth adding coverage for the non-matching-port case.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

metcoder95 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
metcoder95
metcoder95 approved these changes Sep 10, 2026
View reviewed changes
@mcollina
mcollina merged commit 0712f7d into nodejs:main Sep 13, 2026
38 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mcollina
mcollina deleted the fix-noproxy-wildcard-semantics branch September 13, 2026 19:13
@github-actions github-actions Bot mentioned this pull request Sep 14, 2026
[Release] v8.11.0 #5821
Closed
This was referenced Sep 21, 2026
[Release] v8.11.0 #5848
Closed
[Release] v8.11.0 #5849
Merged
@ethanolivertroy ethanolivertroy mentioned this pull request Oct 27, 2026
Clear the CLI's production npm audit advisories ethanolivertroy/grclanker#325
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@metcoder95 metcoder95 metcoder95 approved these changes
+1 more reviewer
@inoway46 inoway46 inoway46 left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@mcollina @codecov-commenter @metcoder95 @inoway46
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.