Skip to content

url: validate href setter receiver first - #67350

Open
Dansatch wants to merge 1 commit into
nodejs:mainfrom
Dansatch:fix-url-href-invalid-receiver
Open

Dansatch wants to merge 1 commit into
nodejs:mainfrom
Dansatch:fix-url-href-invalid-receiver

Conversation

@Dansatch

@Dansatch Dansatch commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Fixes: #67344

Validate the URL.href setter receiver before converting the assigned value.

This prevents a user-defined toString() from running when the setter is called with an incompatible receiver, matching the Web IDL ordering requirements.

A regression test confirms that value conversion does not happen in this case.

Validate the URL receiver before converting the assigned href value.

Fixes: nodejs#67344
Signed-off-by: dansatch <dansatch98@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/url

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. whatwg-url Issues and PRs related to the WHATWG URL implementation. labels Nov 8, 2026
@codecov

codecov Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.70%. Comparing base (82940d6) to head (4efe1c7).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67350      +/-   ##
==========================================
+ Coverage   90.68%   90.70%   +0.01%     
==========================================
  Files         797      797              
  Lines      279572   279573       +1     
  Branches    53781    53783       +2     
==========================================
+ Hits       253543   253579      +36     
+ Misses      16302    16286      -16     
+ Partials     9727     9708      -19     
Files with missing lines Coverage Δ
lib/internal/url.js 93.46% <100.00%> (+0.06%) ⬆️

... and 23 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.

@aduh95 aduh95 added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Nov 8, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 8, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

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

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. needs-ci PRs that need a full CI run. whatwg-url Issues and PRs related to the WHATWG URL implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

url: href setter converts its value before validating the receiver

3 participants