Repository navigation
Conversation
|
Review requested:
|
|
Welcome to Node.js, and thank you for your first contribution! Before review, please take a moment to read:
Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal. Caution AgentScan found account activity patterns that may be consistent with automation. This is a heuristic, not proof that this pull request was opened by an agent or violates policy. AI-assisted contributions are permitted, but automated tooling must not open pull requests without advance approval, and contributors must personally understand, test, verify, and take responsibility for every submitted change. See the AgentScan analysis, AI use policy, and automation policy for additional context. |
The node:http2 and node:http modules use different lists of incoming headers that discard duplicates. For example, node:http joins duplicate date, if-match, and range headers, but node:http2 discards them. For the server header, the behavior is the opposite. Add a note after the node:http2 list. The note tells users about the difference. It also tells them to use the raw headers when they must get all values. Signed-off-by: hicay <caglarispirli@gmail.com>
37119fe to
9755b61
Compare
The
node:http2documentation lists the incoming headers that discard duplicates. Thenode:httpdocumentation has a different list. No page tells users about this difference. Thus, an application that serves both protocols can get different values for the same request.I did a test on v26.14.0. I sent each header below two times (
oneandtwo), on HTTP/1.1 and on HTTP/2. Then I comparedreq.headers:node:httpnode:http2date,if-match,if-none-match,if-range,range,content-language,content-location,content-md5,content-range,dnt,tk,upgrade-insecure-requests,x-content-type-options,access-control-allow-credentials,access-control-max-age,access-control-request-method'one, two''one'server'one''one, two'This change adds a short note after the
node:http2list. The note gives examples of the difference. It also tells users to use the raw headers when they must get all values.This change is documentation only. It does not change behavior.
node tools/lint-md/lint-md.mjs doc/api/http2.mdpasses.AI disclosure: A coding agent helped me write this note and run the header test. I examined the result against the source code:
kSingleValueFieldsinlib/internal/http2/util.jsand the known-field table inlib/internal/http/incoming.js.