Skip to content
Myr

perf: improve req.ips performance

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

closes #2723

authored by Ángel Sanz · committed by Douglas Christopher Wilson · parent 906164b · Browse files · 2 files+7 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+7 added−1 removed

  • other:+7 added−1 removed

2 files+7 added−1 removed

modified:lib/request.js+6 added-1 removed
354 unmodified lines
355356defineGetter(req, 'ips', function ips() {357 var trust = this.app.get('trust proxy fn');358 var addrs = proxyaddr.all(this, trust);359 return addrs.slice(1).reverse();359360 // reverse the order (to farthest -> closest)361 // and remove socket address362 addrs.reverse().pop()363364 return addrs365});366367/**368 * Return subdomains as an array.
139 unmodified lines
modified:History.md+1 added
9 unmodified lines
10 - deps: ms@0.7.211 * deps: qs@6.3.112 - Fix array parsing from skipping empty values13 - Fix compacting nested arrays14 * perf: improve `req.ips` performance15164.14.1 / 2017-01-2817===================18
3159 unmodified lines