Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
9 changes: 7 additions & 2 deletions lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

Expand Down Expand Up @@ -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];

Expand Down