From 2de98682927c1d0d95ef8ce8a5b42d42032f66f7 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Fri, 21 Jul 2023 13:19:08 -0400 Subject: [PATCH] test: validate host with commas on url.parse PR-URL: https://github.com/nodejs/node/pull/48878 Backport-PR-URL: https://github.com/nodejs/node/pull/48873 Refs: https://github.com/nodejs/node/pull/48873 Refs: https://github.com/nodejs/node/issues/48855 Refs: https://github.com/nodejs/node/issues/48850 Reviewed-By: Luigi Pinca Reviewed-By: Benjamin Gruenbaum Reviewed-By: Antoine du Hamel --- test/parallel/test-url-parse-format.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/parallel/test-url-parse-format.js b/test/parallel/test-url-parse-format.js index ef4aad51d0e3ac..f8761514a30b72 100644 --- a/test/parallel/test-url-parse-format.js +++ b/test/parallel/test-url-parse-format.js @@ -1007,6 +1007,22 @@ const parseTests = { path: '/', href: 'https://evil.com$.example.com/' }, + + // Validate the output of hostname with commas. + 'x://0.0,1.1/': { + protocol: 'x:', + slashes: true, + auth: null, + host: '0.0,1.1', + port: null, + hostname: '0.0,1.1', + hash: null, + search: null, + query: null, + pathname: '/', + path: '/', + href: 'x://0.0,1.1/' + } }; for (const u in parseTests) {