Skip to content

Commit cce0504

Browse files
committed
doc: fix incorrect claim about Host header in fetch
Host remains a restricted header in Node.js fetch since CVE-2023-45143. Change "No forbidden headers" to "Fewer forbidden headers" and note the Host restriction. Ref: nodejs/undici#2369
1 parent 0c51ed0 commit cce0504

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

doc/api/globals.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,10 +596,11 @@ implementations in several ways:
596596
[CORS][]. Node.js does not send preflight requests or validate
597597
`Access-Control-Allow-Origin` headers, since server-side requests do
598598
not have an origin. All cross-origin requests are allowed by default.
599-
* **No forbidden headers.** The [Fetch Standard][] forbids setting
599+
* **Fewer forbidden headers.** The [Fetch Standard][] forbids setting
600600
certain headers (such as `Cookie`, `Host`, and `Origin`) in browser
601-
contexts. Node.js removes these restrictions, allowing full control
602-
over all request headers.
601+
contexts. Node.js removes most of these restrictions (for example,
602+
`Cookie` and `Origin` can be set freely), but some headers such as
603+
`Host` remain restricted for security reasons.
603604
* **`Response` accepts async iterables.** `new Response(body)` accepts
604605
async iterables as the `body` argument. This is a Node.js extension
605606
not present in the Fetch Standard.

0 commit comments

Comments
 (0)