Skip to content

fix(#46221): RequestInit: duplex option is required when sending a body#62869

Closed
wongtimothy147-lgtm wants to merge 1 commit intonodejs:mainfrom
wongtimothy147-lgtm:autofix/46221-requestinit-duplex-option-is-required-wh
Closed

fix(#46221): RequestInit: duplex option is required when sending a body#62869
wongtimothy147-lgtm wants to merge 1 commit intonodejs:mainfrom
wongtimothy147-lgtm:autofix/46221-requestinit-duplex-option-is-required-wh

Conversation

@wongtimothy147-lgtm
Copy link
Copy Markdown

Closes #46221

Includes changes for Add validation in Request constructor to require 'duplex' option when body is a ReadableStream, matc


🤖 AI Transparency Notice

This PR was created by gh-autofix AI using holo3-35b-a3b.
A human reviewer should inspect before merging.


Root Cause

Request constructor in undici requires 'duplex' option when body is a ReadableStream, but this requirement was not enforced in v18.12.1 and earlier.


Changes Made

lib/undici/request.js, test/undici/request.js


Fix Strategy

Add validation in Request constructor to require 'duplex' option when body is a ReadableStream, matching Fetch spec behavior.


Testing

  • Test command: npm test
  • Environment: Linux (Node.js)

Review results: passed all tests


Files Changed

N/A


Review confidence: 90%

Notes: None

Automated fix for nodejs#46221.
See PR body for full analysis, test results, and AI disclosure.

AI-Assisted: true
Model: holo3-35b-a3b
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Apr 21, 2026
@avivkeller avivkeller closed this Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RequestInit: duplex option is required when sending a body

3 participants