test: expand http2 util test coverage for headers
Expand existing test cases to hit some additional branches of toHeaderObject and mapToHeaders. PR-URL: https://github.com/nodejs/node/pull/15493 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
d9cc105102
commit
d8a226673b
@ -11,7 +11,8 @@ const server = h2.createServer();
|
|||||||
|
|
||||||
const setCookie = [
|
const setCookie = [
|
||||||
'a=b',
|
'a=b',
|
||||||
'c=d; Wed, 21 Oct 2015 07:28:00 GMT; Secure; HttpOnly'
|
'c=d; Wed, 21 Oct 2015 07:28:00 GMT; Secure; HttpOnly',
|
||||||
|
'e=f'
|
||||||
];
|
];
|
||||||
|
|
||||||
// we use the lower-level API here
|
// we use the lower-level API here
|
||||||
|
@ -261,4 +261,10 @@ const regex =
|
|||||||
})(mapToHeaders({ [name]: 'abc' }));
|
})(mapToHeaders({ [name]: 'abc' }));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
common.expectsError({
|
||||||
|
code: 'ERR_HTTP2_INVALID_CONNECTION_HEADERS',
|
||||||
|
message: regex
|
||||||
|
})(mapToHeaders({ [HTTP2_HEADER_TE]: ['abc'] }));
|
||||||
|
|
||||||
assert(!(mapToHeaders({ te: 'trailers' }) instanceof Error));
|
assert(!(mapToHeaders({ te: 'trailers' }) instanceof Error));
|
||||||
|
assert(!(mapToHeaders({ te: ['trailers'] }) instanceof Error));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user