diff --git a/History.md b/History.md index 57df902afe..493ea189ff 100644 --- a/History.md +++ b/History.md @@ -4,6 +4,7 @@ unreleased * deps: accepts@~1.3.8 - deps: mime-types@~2.1.34 - deps: negotiator@0.6.3 + * pref: remove unnecessary regexp for trust proxy 4.17.2 / 2021-12-16 =================== diff --git a/lib/utils.js b/lib/utils.js index a9ef259ff1..7797b06853 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -228,7 +228,8 @@ exports.compileTrust = function(val) { if (typeof val === 'string') { // Support comma-separated values - val = val.split(/ *, */); + val = val.split(',') + .map(function (v) { return v.trim() }) } return proxyaddr.compile(val || []);