From 02104c08bbf5bcb3bbd94541bb62fe2dc0e97cb7 Mon Sep 17 00:00:00 2001 From: Kit Dallege Date: Tue, 24 Mar 2026 11:49:30 +0100 Subject: [PATCH] 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: https://github.com/nodejs/node/issues/42619 Co-Authored-By: Claude Opus 4.6 PR-URL: https://github.com/nodejs/node/pull/62206 Reviewed-By: Tim Perry Reviewed-By: Luigi Pinca --- doc/api/http.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/api/http.md b/doc/api/http.md index 50f0ad464b5..23b63ec9d7c 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -2319,8 +2319,8 @@ added: v0.7.5 When true, the Date header will be automatically generated and sent in the response if it is not already present in the headers. Defaults to true. -This should only be disabled for testing; HTTP requires the Date header -in responses. +This should only be disabled for testing; the Date header is required in +most HTTP responses (see [RFC 9110 Section 6.6.1][] for details). ### `response.setHeader(name, value)` @@ -4583,6 +4583,7 @@ const agent2 = new http.Agent({ proxyEnv: process.env }); [Built-in Proxy Support]: #built-in-proxy-support [RFC 8187]: https://www.rfc-editor.org/rfc/rfc8187.txt +[RFC 9110 Section 6.6.1]: https://www.rfc-editor.org/rfc/rfc9110#section-6.6.1 [`'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`]: errors.md#err_http_content_length_mismatch [`'checkContinue'`]: #event-checkcontinue [`'finish'`]: #event-finish