From f9aad40351e063d5abeb097e8eab4904d88e94e6 Mon Sep 17 00:00:00 2001 From: joamag Date: Fri, 28 Feb 2020 16:16:58 +0000 Subject: [PATCH] New proxy header validation --- lib/proxy/proxy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/proxy/proxy.js b/lib/proxy/proxy.js index 450cd75..fd7799e 100644 --- a/lib/proxy/proxy.js +++ b/lib/proxy/proxy.js @@ -7,13 +7,13 @@ function proxyHeaders(req) { }); if ( - !headers["x-forwarded-for"] !== undefined && + !headers["x-forwarded-for"] === undefined && req.connection !== undefined && req.connection.remoteAddress !== undefined ) { headers["x-forwarded-for"] = req.connection.remoteAddress; } - if (!headers["x-forwarded-proto"] !== undefined && req.protocol !== undefined) { + if (!headers["x-forwarded-proto"] === undefined && req.protocol !== undefined) { headers["x-forwarded-proto"] = req.protocol; }