http2: do not modify explicity set date headers · nodejs/node@4d0129a · GitHub
Skip to content

Commit 4d0129a

Browse files
rexagodaddaleax
authored andcommitted
http2: do not modify explicity set date headers
Fixes: #30894 Refs: #29829 PR-URL: #33160 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 867c451 commit 4d0129a

3 files changed

Lines changed: 36 additions & 1 deletion

File tree

doc/api/http2.md

Lines changed: 10 additions & 0 deletions

lib/internal/http2/core.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2199,7 +2199,10 @@ function processHeaders(oldHeaders) {
21992199
const statusCode =
22002200
headers[HTTP2_HEADER_STATUS] =
22012201
headers[HTTP2_HEADER_STATUS] | 0 || HTTP_STATUS_OK;
2202-
headers[HTTP2_HEADER_DATE] = utcDate();
2202+
2203+
if (headers[HTTP2_HEADER_DATE] === null ||
2204+
headers[HTTP2_HEADER_DATE] === undefined)
2205+
headers[HTTP2_HEADER_DATE] = utcDate();
22032206

22042207
// This is intentionally stricter than the HTTP/1 implementation, which
22052208
// allows values between 100 and 999 (inclusive) in order to allow for
Lines changed: 22 additions & 0 deletions

0 commit comments

Comments
 (0)