summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuigi Pinca <luigipinca@gmail.com>2019-07-07 07:59:44 +0200
committerMichaƫl Zasso <targos@protonmail.com>2019-07-20 11:05:24 +0200
commit5b9c22710aa7278fc2182e021aa1b5cdd4900298 (patch)
treed56b5238059cd9d0ed192382fcc2655012711d13 /test
parent9be1111179e7460552b4b362811c2ab95fa7f48d (diff)
downloadandroid-node-v8-5b9c22710aa7278fc2182e021aa1b5cdd4900298.tar.gz
android-node-v8-5b9c22710aa7278fc2182e021aa1b5cdd4900298.tar.bz2
android-node-v8-5b9c22710aa7278fc2182e021aa1b5cdd4900298.zip
http2: override authority with options
Make `options.host` and `options.port` take precedence over `authority.host` and `authority.port` respectively. PR-URL: https://github.com/nodejs/node/pull/28584 Fixes: https://github.com/nodejs/node/issues/28182 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-http2-connect.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/parallel/test-http2-connect.js b/test/parallel/test-http2-connect.js
index 2137ef2892..a1291e3be9 100644
--- a/test/parallel/test-http2-connect.js
+++ b/test/parallel/test-http2-connect.js
@@ -101,3 +101,18 @@ if (hasIPv6) {
}
}));
}
+
+// Check that `options.host` and `options.port` take precedence over
+// `authority.host` and `authority.port`.
+{
+ const server = createServer();
+ server.listen(0, mustCall(() => {
+ connect('http://foo.bar', {
+ host: 'localhost',
+ port: server.address().port
+ }, mustCall((session) => {
+ session.close();
+ server.close();
+ }));
+ }));
+}