mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
test: replace forEach test-http-server-multiheaders2
PR-URL: https://github.com/nodejs/node/pull/50794 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
c74c514273
commit
6b530aee24
1 file changed
+4
-4
@@ -70,15 +70,15 @@ const multipleForbidden = [
|
||||
];
|
||||
|
||||
const server = http.createServer(function(req, res) {
|
||||
multipleForbidden.forEach(function(header) {
|
||||
for (const header of multipleForbidden) {
|
||||
assert.strictEqual(req.headers[header.toLowerCase()], 'foo',
|
||||
`header parsed incorrectly: ${header}`);
|
||||
});
|
||||
multipleAllowed.forEach(function(header) {
|
||||
}
|
||||
for (const header of multipleAllowed) {
|
||||
const sep = (header.toLowerCase() === 'cookie' ? '; ' : ', ');
|
||||
assert.strictEqual(req.headers[header.toLowerCase()], `foo${sep}bar`,
|
||||
`header parsed incorrectly: ${header}`);
|
||||
});
|
||||
}
|
||||
|
||||
res.writeHead(200, { 'Content-Type': 'text/plain' });
|
||||
res.end('EOF');
|
||||
|
||||
Reference in new issue
Block a user