• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2const common = require('../common');
3if (!common.hasCrypto) { common.skip('missing crypto'); }
4const assert = require('assert');
5const http2 = require('http2');
6
7const server = http2.createServer(common.mustCall((request, response) => {
8  response.sendDate = false;
9  response.writeHead(200);
10  response.end();
11}));
12
13server.listen(0, common.mustCall(() => {
14  const session = http2.connect(`http://localhost:${server.address().port}`);
15  const req = session.request();
16
17  req.on('response', common.mustCall((headers, flags) => {
18    assert.strictEqual('Date' in headers, false);
19    assert.strictEqual('date' in headers, false);
20  }));
21
22  req.on('end', common.mustCall(() => {
23    session.close();
24    server.close();
25  }));
26}));
27