-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http2: do not modify explicity set date headers
Fixes: #30894 Refs: #29829 PR-URL: #33160 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
- Loading branch information
1 parent
2380d90
commit 7ccb021
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
if (!common.hasCrypto) { common.skip('missing crypto'); } | ||
const assert = require('assert'); | ||
const http2 = require('http2'); | ||
|
||
const server = http2.createServer(common.mustCall((request, response) => { | ||
response.setHeader('date', 'snacks o clock'); | ||
response.end(); | ||
})); | ||
|
||
server.listen(0, common.mustCall(() => { | ||
const session = http2.connect(`http://localhost:${server.address().port}`); | ||
const req = session.request(); | ||
req.on('response', (headers, flags) => { | ||
assert.deepStrictEqual(headers.date, 'snacks o clock'); | ||
}); | ||
req.on('end', () => { | ||
session.close(); | ||
server.close(); | ||
}); | ||
})); |