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 }); 19 stream.session.destroy(); 20 server.close(); 21}); 22server.listen(0, common.mustCall(() => { 23 const client = http2.connect(`http://localhost:${server.address().port}/`); 24 client.request({ ':path': '/', '': 'foo', 'bar': '' }).end(); 25})); 26