Skip to content
Myr

Support X-Forwarded-Host in req.subdomains

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

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent 4e97533 · Browse files · 3 files+21 added−4 removed
This commit

State

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

Diff stats

3 files+21 added−4 removed

  • tests:+16 added−0 removed
  • other:+5 added−4 removed

3 files+21 added−4 removed

modified:lib/request.js+4 added-4 removed
450 unmodified lines
451 * @api public452 */453454req.__defineGetter__('subdomains', function(){455 var host = this.host;456 var offset = this.app.get('subdomain offset');456 return (this.host || '')457 .split('.')458 .reverse()459 .slice(offset);457 var subdomains = host.split('.').reverse();458459 return subdomains.slice(offset);460});461462/**463 * Short-hand for `url.parse(req.url).pathname`.
89 unmodified lines
modified:test/req.subdomains.js+16 added
modified:History.md+1 added
13.x2===34 * Support `X-Forwarded-Host` in `req.subdomains`5 * deps: connect@2.26.06 - deps: body-parser@~1.8.17 - deps: compression@~1.1.08 - deps: connect-timeout@~1.3.0
1741 unmodified lines