Skip to content

Commit

Permalink
Check the x-forwarded-proto header before redirecting to HTTPS (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelpurra committed Jul 1, 2015
1 parent 083c515 commit bcb0e9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/configuredHttpsRedirect.js
Expand Up @@ -15,7 +15,7 @@ var configuration = require("configvention"),

configuredHttpsRedirect = function() {
var middleware = function(req, res, next) {
if (req.secure !== true && configuration.get("redirect-to-https") === true) {
if (req.headers["x-forwarded-proto"] !== "https" && configuration.get("redirect-to-https") === true) {
redirectRequestToHttps(req, res);
} else {
next();
Expand Down

0 comments on commit bcb0e9f

Please sign in to comment.