Skip to content

Commit

Permalink
If multiple x-forwarded-proto use first
Browse files Browse the repository at this point in the history
  • Loading branch information
manics committed Oct 15, 2020
1 parent 3db533f commit cde6854
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/configproxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,12 @@ class ConfigurableProxy extends EventEmitter {
return;
}

// X-Forwarded-Proto may have multiple values, Tornado uses the last but we want the first
if (req.headers['x-forwarded-proto']) {
req.headers['x-forwarded-proto'] = req.headers['x-forwarded-proto'].split(',')[0];
that.log.debug('Using first x-forwarded-proto: ' + req.headers['x-forwarded-proto'])
}

if (kind === "web") {
that.emit("proxyRequest", req, res);
}
Expand Down

0 comments on commit cde6854

Please sign in to comment.