1'use strict'; 2const common = require('../common'); 3if (!common.hasCrypto) 4 common.skip('missing crypto'); 5 6const assert = require('assert'); 7const http2 = require('http2'); 8 9const server = http2.createServer(); 10server.on('stream', (stream, headers) => { 11 assert.deepStrictEqual(headers, { 12 ':scheme': 'http', 13 ':authority': `localhost:${server.address().port}`, 14 ':method': 'GET', 15 ':path': '/', 16 'bar': '', 17 '__proto__': null, 18 [http2.sensitiveHeaders]: [] 19 }); 20 stream.session.destroy(); 21 server.close(); 22}); 23server.listen(0, common.mustCall(() => { 24 const client = http2.connect(`http://localhost:${server.address().port}/`); 25 client.request({ ':path': '/', '': 'foo', 'bar': '' }).end(); 26})); 27