diff options
author | Trivikram Kamat <trivikr.dev@gmail.com> | 2017-10-17 06:47:38 +0300 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2017-10-24 00:18:18 +0300 |
commit | 25ef3722356e7398dd92286dfa381427b0613d04 (patch) | |
tree | b2fda21a479eeb599fbe77ad4484810e59bed3a5 /test | |
parent | 6b1f75d26f627b5c4c58c9c9f4bf8bd7989135e3 (diff) |
http2: simplify te header validation, add test
This simplifies validation of te header and adds a test case
in which array with two values is passed to param value in
isIllegalConnectionSpecificHeader
PR-URL: https://github.com/nodejs/node/pull/16246
Refs: https://github.com/nodejs/node/issues/14985
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-http2-util-headers-list.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/parallel/test-http2-util-headers-list.js b/test/parallel/test-http2-util-headers-list.js index 0bc06bb7277..1884a22894d 100644 --- a/test/parallel/test-http2-util-headers-list.js +++ b/test/parallel/test-http2-util-headers-list.js @@ -266,5 +266,10 @@ common.expectsError({ message: regex })(mapToHeaders({ [HTTP2_HEADER_TE]: ['abc'] })); +common.expectsError({ + code: 'ERR_HTTP2_INVALID_CONNECTION_HEADERS', + message: regex +})(mapToHeaders({ [HTTP2_HEADER_TE]: ['abc', 'trailers'] })); + assert(!(mapToHeaders({ te: 'trailers' }) instanceof Error)); assert(!(mapToHeaders({ te: ['trailers'] }) instanceof Error)); |