From 2c1b2d409dbace088c94317fc09c35af57ea5ccb Mon Sep 17 00:00:00 2001 From: hasan19524 Date: Mon, 2 Nov 2026 17:51:57 +0530 Subject: [PATCH 1/3] fix: handle bracketed IPv6 hosts in req.subdomains --- lib/request.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/request.js b/lib/request.js index c0506334ce2..7521f9d8606 100644 --- a/lib/request.js +++ b/lib/request.js @@ -386,7 +386,12 @@ defineGetter(req, 'subdomains', function subdomains() { if (!hostname) return []; var offset = this.app.get('subdomain offset'); - var subdomains = !isIP(hostname) + // IPv6 literals are returned bracketed (e.g. "[::1]"); strip the brackets + // before the IP check so they are not split on "." like a hostname. + var host = hostname[0] === '[' + ? hostname.slice(1, hostname.indexOf(']')) + : hostname; + var subdomains = !isIP(host) ? hostname.split('.').reverse() : [hostname]; From 0ceaea0bf19add862f971a2b4d9d40d96e636cbc Mon Sep 17 00:00:00 2001 From: hasan19524 Date: Mon, 2 Nov 2026 17:57:48 +0530 Subject: [PATCH 2/3] docs: fix req.query JSDoc return type (Object, not String) --- lib/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/request.js b/lib/request.js index 7521f9d8606..8b22872a7fe 100644 --- a/lib/request.js +++ b/lib/request.js @@ -223,7 +223,7 @@ req.range = function range(size, options) { * This uses the "query parser" setting to parse the raw * string into an object. * - * @return {String} + * @return {Object} * @api public */ From 7e14034513c90e43ac13ecea983a5c282cf09196 Mon Sep 17 00:00:00 2001 From: hasan19524 Date: Mon, 2 Nov 2026 17:58:43 +0530 Subject: [PATCH 3/3] docs: capitalize Express.js project name in README --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 393c992807c..b9aab893683 100644 --- a/Readme.md +++ b/Readme.md @@ -176,7 +176,7 @@ npm test ## Current project team members -For information about the governance of the express.js project, see [GOVERNANCE.md](https://github.com/expressjs/discussions/blob/HEAD/docs/GOVERNANCE.md). +For information about the governance of the Express.js project, see [GOVERNANCE.md](https://github.com/expressjs/discussions/blob/HEAD/docs/GOVERNANCE.md). The original author of Express is [TJ Holowaychuk](https://github.com/tj)