Skip to content
Myr

Fix req.protocol/req.secure when using "trust proxy" hops count

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

fixes #2569 closes #2570

authored by Paul Serby · committed by Douglas Christopher Wilson · parent bb4703e · Browse files · 4 files+40 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

4 files+40 added−1 removed

  • tests:+34 added−0 removed
  • other:+6 added−1 removed

4 files+40 added−1 removed

modified:lib/request.js+1 added-1 removed
356 unmodified lines
357 ? 'https'358 : 'http';359 var trust = this.app.get('trust proxy fn');360361 if (!trust(this.connection.remoteAddress)) {361 if (!trust(this.connection.remoteAddress, 0)) {362 return proto;363 }364365 // Note: X-Forwarded-Proto is normally only ever a
193 unmodified lines
modified:test/req.protocol.js+17 added
modified:test/req.secure.js+17 added
modified:History.md+5 added
13.x2===34 * Fix `req.protocol`/`req.secure` when using "trust proxy" hops count563.20.0 / 2015-02-187===================89 * Fix `"trust proxy"` setting to inherit when app is mounted
1987 unmodified lines