Skip to content

doc: document Node.js fetch() differences from standard#63676

Closed
Aanushka001 wants to merge 1 commit into
nodejs:mainfrom
Aanushka001:doc-fetch-differences
Closed

doc: document Node.js fetch() differences from standard#63676
Aanushka001 wants to merge 1 commit into
nodejs:mainfrom
Aanushka001:doc-fetch-differences

Conversation

@Aanushka001
Copy link
Copy Markdown

This PR adds documentation for intentional differences between Node.js's
fetch() implementation (based on undici) and the WHATWG Fetch Standard,
covering:

  • new Response(asyncIterable) as an addition to the standard
  • Cookies handling differences
  • No forbidden headers enforcement
  • No CORS checks

Refs: #52163

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label May 31, 2026
@bakkot
Copy link
Copy Markdown
Contributor

bakkot commented May 31, 2026

There are at least two open PRs for this already: #61837 #62236

@Aanushka001
Copy link
Copy Markdown
Author

Hi @Aanushka001! πŸ‘‹ Thank you for taking the time to contribute documentation for the Node.js fetch() differences β€” it's great to see interest in this area!

I wanted to let you know that this PR overlaps significantly with two existing pull requests that have already been submitted:

  1. PR doc: document fetch() differences from the Fetch StandardΒ #62236 by @kovan (open) β€” This is the most comprehensive PR, documenting 6 differences including:

    • No CORS enforcement
    • Fewer forbidden headers (with Host still restricted β€” corrected per @bakkot's review)
    • Response accepts async iterables
    • Response bodies must be consumed to avoid connection leaks
    • Content-Encoding layer limit of 5
    • Manual redirect returns actual response
  2. PR doc: add section about fetch() differences from standardΒ #61837 by @akachi10 (open) β€” Covers async iterable response bodies, cookies handling, and forbidden headers restriction removal.

All 4 items covered in your PR (new Response(asyncIterable), cookies handling, no forbidden headers enforcement, no CORS checks) are already addressed by these earlier PRs β€” particularly #62236 which is more comprehensive.

Also, a small note: your PR mentions "no forbidden headers enforcement," but this was corrected in #62236 by @bakkot's review β€” it should be "fewer forbidden headers, with Host still restricted," as Node.js does still restrict certain headers like Host.

Given this overlap, would you consider closing this PR in favor of the earlier, more comprehensive #62236 (and partially #61837)? Your help reviewing or contributing to those existing PRs would be very valuable! Thank you again for your work on this. πŸ™

@Aanushka001
Copy link
Copy Markdown
Author

Closing this - it's a duplicate of #62236 which already covers these differences more comprehensively.

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

Labels

doc Issues and PRs related to the documentations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants