Skip to content

fix(request): reject NaN highWaterMark during option validation#5062

Merged
mcollina merged 1 commit intonodejs:mainfrom
trivikr:highWaterMark-NaN
Apr 19, 2026
Merged

fix(request): reject NaN highWaterMark during option validation#5062
mcollina merged 1 commit intonodejs:mainfrom
trivikr:highWaterMark-NaN

Conversation

@trivikr
Copy link
Copy Markdown
Member

@trivikr trivikr commented Apr 19, 2026

This relates to...

Fixes: #5061

Rationale

NaN was bypassing request option validation because the current guard used a truthiness check. That allowed the request to progress until the response body stream was created, where Node then threw ERR_INVALID_ARG_VALUE from the Readable constructor.

Changes

Update RequestHandler option validation to reject non-finite highWaterMark values when provided

Features

N/A

Bug Fixes

highWaterMark: NaN is rejected during option validation instead of surfacing later as Node's ERR_INVALID_ARG_VALUE

Breaking Changes and Deprecations

N/A

Status

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.10%. Comparing base (a1d6766) to head (f2e3c01).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5062      +/-   ##
==========================================
- Coverage   93.10%   93.10%   -0.01%     
==========================================
  Files         110      110              
  Lines       35770    35770              
==========================================
- Hits        33303    33302       -1     
- Misses       2467     2468       +1     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit e1211a5 into nodejs:main Apr 19, 2026
35 checks passed
@trivikr trivikr deleted the highWaterMark-NaN branch April 19, 2026 10:53
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.

request: highWaterMark: NaN bypasses validation and throws ERR_INVALID_ARG_VALUE later

3 participants