Skip to content
Myr

fix `req.subdomains` when no Host is present

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parent 06ead58 · Browse files · 2 files+16 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+16 added−1 removed

  • tests:+15 added−0 removed
  • other:+1 added−1 removed

2 files+16 added−1 removed

modified:lib/request.js+1 added-1 removed
443 unmodified lines
444 */445446req.__defineGetter__('subdomains', function(){447 var offset = this.app.get('subdomain offset');448 return this.get('Host')448 return (this.host || '')449 .split('.')450 .reverse()451 .slice(offset);452});
75 unmodified lines
modified:test/req.subdomains.js+15 added