Skip to content
Myr

Considering X-Forwarded-Host header if proxy is trusted

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

authored by Candid Dauth · committed by Candid Dauth · parent 158f452 · Browse files · 1 file+3 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

1 file+3 added−1 removed

  • other:+3 added−1 removed

1 file+3 added−1 removed

modified:lib/request.js+3 added-1 removed
438 unmodified lines
439 * @api public440 */441442req.__defineGetter__('host', function(){443 return this.get('Host').split(':')[0];443 var trustProxy = this.app.get('trust proxy');444 return (trustProxy && this.get('X-Forwarded-Host') || this.get('Host'))445 .split(':')[0];446});447448/**449 * Check if the request is fresh, aka
46 unmodified lines