Skip to content

Commit 02104c0

Browse files
kovanclaude
andauthored
doc: fix overstated Date header requirement in response.sendDate
The docs stated "HTTP requires the Date header in responses" which oversimplifies the actual requirement. Per RFC 9110 Section 6.6.1, the Date header is required only in most responses (2xx/3xx/4xx from servers with a clock), not all. Reference the specific RFC section. Fixes: #42619 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> PR-URL: #62206 Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent a98d9f6 commit 02104c0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/api/http.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,8 +2319,8 @@ added: v0.7.5
23192319
When true, the Date header will be automatically generated and sent in
23202320
the response if it is not already present in the headers. Defaults to true.
23212321

2322-
This should only be disabled for testing; HTTP requires the Date header
2323-
in responses.
2322+
This should only be disabled for testing; the Date header is required in
2323+
most HTTP responses (see [RFC 9110 Section 6.6.1][] for details).
23242324

23252325
### `response.setHeader(name, value)`
23262326

@@ -4583,6 +4583,7 @@ const agent2 = new http.Agent({ proxyEnv: process.env });
45834583
45844584
[Built-in Proxy Support]: #built-in-proxy-support
45854585
[RFC 8187]: https://www.rfc-editor.org/rfc/rfc8187.txt
4586+
[RFC 9110 Section 6.6.1]: https://www.rfc-editor.org/rfc/rfc9110#section-6.6.1
45864587
[`'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`]: errors.md#err_http_content_length_mismatch
45874588
[`'checkContinue'`]: #event-checkcontinue
45884589
[`'finish'`]: #event-finish

0 commit comments

Comments
 (0)