Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
New proxy header validation
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Feb 28, 2020
1 parent ba286cd commit f9aad40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/proxy/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit f9aad40

Please sign in to comment.