summaryrefslogtreecommitdiff
path: root/test/parallel/test-http2-util-headers-list.js
diff options
context:
space:
mode:
authorTrivikram Kamat <trivikr.dev@gmail.com>2017-10-16 20:47:38 -0700
committerAnatoli Papirovski <apapirovski@mac.com>2017-10-19 07:53:09 -0400
commit1fd662c0e38a89308e0fcd85f1c98cc94dda5a98 (patch)
tree4562db6676b7cebb43aedd77d596894857d16ecf /test/parallel/test-http2-util-headers-list.js
parent532d8b24fd70a25cdb72ca12f3387f8ed29a91e7 (diff)
downloadandroid-node-v8-1fd662c0e38a89308e0fcd85f1c98cc94dda5a98.tar.gz
android-node-v8-1fd662c0e38a89308e0fcd85f1c98cc94dda5a98.tar.bz2
android-node-v8-1fd662c0e38a89308e0fcd85f1c98cc94dda5a98.zip
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/parallel/test-http2-util-headers-list.js')
-rw-r--r--test/parallel/test-http2-util-headers-list.js5
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 0bc06bb727..1884a22894 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));