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; }