From 06b37da1a1d056a1083c119d9b422fde8f91ef76 Mon Sep 17 00:00:00 2001 From: Joshua Chan Date: Wed, 20 Mar 2019 05:32:55 -0700 Subject: [PATCH] =?UTF-8?q?Added=20support=20for=20=E2=80=9Cx-forwarded-pr?= =?UTF-8?q?oto=E2=80=9D=20header.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/passport-cas.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/passport-cas.js b/lib/passport-cas.js index d851f5b..2252037 100644 --- a/lib/passport-cas.js +++ b/lib/passport-cas.js @@ -128,7 +128,7 @@ CasStrategy.prototype.authenticate = function(req, options) { // The `service` string is the current URL, minus the ticket delete reqURL.query['ticket']; service = url.format({ - protocol: req.headers['x-proxied-protocol'] || req.protocol || 'http', + protocol: req.headers['x-forwarded-proto'] || req.headers['x-proxied-protocol'] || req.protocol || 'http', host: req.headers['x-forwarded-host'] || req.headers.host || reqURL.host, pathname: req.headers['x-proxied-request-uri'] || reqURL.pathname, query: reqURL.query