mirror of
https://github.com/nodejs/node.git
synced 2025-05-07 15:35:41 +00:00

Arguments of deepStrictEqual were in incorrect order. Swap first argument (actual value) with the second one (expected value) to make the order correct. PR-URL: https://github.com/nodejs/node/pull/27885 Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
50 lines
1.1 KiB
JavaScript
50 lines
1.1 KiB
JavaScript
'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();
|
|
|
|
const src = Object.create(null);
|
|
src['www-authenticate'] = 'foo';
|
|
src['WWW-Authenticate'] = 'bar';
|
|
src['WWW-AUTHENTICATE'] = 'baz';
|
|
src.test = 'foo, bar, baz';
|
|
|
|
server.on('stream', common.mustCall((stream, headers, flags, rawHeaders) => {
|
|
const expected = [
|
|
':path',
|
|
'/',
|
|
':scheme',
|
|
'http',
|
|
':authority',
|
|
`localhost:${server.address().port}`,
|
|
':method',
|
|
'GET',
|
|
'www-authenticate',
|
|
'foo',
|
|
'www-authenticate',
|
|
'bar',
|
|
'www-authenticate',
|
|
'baz',
|
|
'test',
|
|
'foo, bar, baz'
|
|
];
|
|
|
|
assert.deepStrictEqual(rawHeaders, expected);
|
|
stream.respond(src);
|
|
stream.end();
|
|
}));
|
|
|
|
server.listen(0, common.mustCall(() => {
|
|
const client = http2.connect(`http://localhost:${server.address().port}`);
|
|
const req = client.request(src);
|
|
req.on('close', common.mustCall(() => {
|
|
server.close();
|
|
client.close();
|
|
}));
|
|
}));
|