From 6fbc269563c53297d29b69b89fd71b74c1dbd6ce Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 4 Feb 2022 16:34:56 -0500 Subject: [PATCH] pref: remove unnecessary regexp for trust proxy --- History.md | 1 + lib/utils.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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 || []);