Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

http: fix no_proxy leading-dot suffix matching#62333

Closed
watilde wants to merge 1 commit into
nodejs:mainnodejs/node:mainfrom
watilde:fix/http-no-proxywatilde/node:fix/http-no-proxyCopy head branch name to clipboard
Closed

http: fix no_proxy leading-dot suffix matching#62333
watilde wants to merge 1 commit into
nodejs:mainnodejs/node:mainfrom
watilde:fix/http-no-proxywatilde/node:fix/http-no-proxyCopy head branch name to clipboard

Conversation

@watilde

@watilde watilde commented Mar 19, 2026

Copy link
Copy Markdown
Member

Fix NO_PROXY suffix matching to prevent partial domain matches

This PR improves NO_PROXY logic by ensuring suffix matches occur only on exact domains or subdomains. Previously, using endsWith() caused false positives (e.g., myexample.com matching .example.com). This aligns with the expected domain boundary matching behavior.

// Run with: ./node --expose-internals -e "$(cat this_file.js)"
'use strict';

const { parseProxyConfigFromEnv } = require('internal/http');
const assert = require('assert');

const config = parseProxyConfigFromEnv({
  http_proxy: 'http://proxy.test:8080',
  no_proxy: '.example.com',
}, 'http:', false);

// These should bypass proxy (false)
assert.strictEqual(config.shouldUseProxy('sub.example.com'), false);
assert.strictEqual(config.shouldUseProxy('example.com'), false);

// These should use proxy (true) β€” currently returns false without the fix
assert.strictEqual(config.shouldUseProxy('notexample.com'), true);
assert.strictEqual(config.shouldUseProxy('badexample.com'), true);

console.log('All assertions passed');

@nodejs-github-bot nodejs-github-bot added http Issues or PRs related to the http subsystem. needs-ci PRs that need a full CI run. labels Mar 19, 2026
@codecov

codecov Bot commented Mar 19, 2026

Copy link
Copy Markdown

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 89.68%. Comparing base (56aba88) to head (abbc102).
⚠️ Report is 282 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62333      +/-   ##
==========================================
- Coverage   91.64%   89.68%   -1.96%     
==========================================
  Files         337      676     +339     
  Lines      140643   206579   +65936     
  Branches    21810    39563   +17753     
==========================================
+ Hits       128893   185272   +56379     
- Misses      11526    13439    +1913     
- Partials      224     7868    +7644     
Files with missing lines Coverage Ξ”
lib/internal/http.js 92.11% <100.00%> (ΓΈ)

... and 460 files with indirect coverage changes

πŸš€ 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.

@watilde watilde added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 30, 2026
@github-actions github-actions Bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Mar 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor
Failed to start CI
   ⚠  No approving reviews found
   ✘  Refusing to run CI on potentially unsafe PR
https://github.com/nodejs/node/actions/runs/23747805701

@watilde watilde removed the request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. label Apr 10, 2026
@watilde watilde requested a review from joyeecheung April 10, 2026 01:34
@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 21, 2026

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 21, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@watilde watilde added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. and removed needs-ci PRs that need a full CI run. labels Apr 23, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Apr 23, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/62333
βœ”  Done loading data for nodejs/node/pull/62333
----------------------------------- PR info ------------------------------------
Title      http: fix no_proxy leading-dot suffix matching (#62333)
Author     Daijiro Wachi <daijiro.wachi@gmail.com> (@watilde)
Branch     watilde:fix/http-no-proxy -> nodejs:main
Labels     http, author ready
Commits    1
 - http: fix no_proxy leading-dot suffix matching
Committers 1
 - Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62333
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/62333
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
--------------------------------------------------------------------------------
   β„Ή  This PR was created on Thu, 19 Mar 2026 06:18:08 GMT
   βœ”  Approvals: 2
   βœ”  - Joyee Cheung (@joyeecheung) (TSC): https://github.com/nodejs/node/pull/62333#pullrequestreview-4147401734
   βœ”  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/62333#pullrequestreview-4147484766
   ✘  GitHub CI failed with status: FAILURE
   β„Ή  Last Full PR CI on 2026-04-22T01:32:30Z: https://ci.nodejs.org/job/node-test-pull-request/72843/
- Querying data for job/node-test-pull-request/72843/
βœ”  Build data downloaded
- Querying failures of job/node-test-commit/87200/
βœ”  Data downloaded
   ✘  1 failure(s) on the last Jenkins CI run
--------------------------------------------------------------------------------
   βœ”  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/24813848187

@watilde watilde added request-ci Add this label to start a Jenkins CI on a PR. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Apr 23, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 23, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

watilde added a commit that referenced this pull request Apr 23, 2026
PR-URL: #62333
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@watilde

watilde commented Apr 23, 2026

Copy link
Copy Markdown
Member Author

Landed in d44a71a

aduh95 pushed a commit that referenced this pull request May 5, 2026
PR-URL: #62333
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
aduh95 pushed a commit that referenced this pull request May 7, 2026
PR-URL: #62333
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
araujogui pushed a commit to araujogui/node that referenced this pull request May 26, 2026
PR-URL: nodejs#62333
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. http Issues or PRs related to the http subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.