Created
October 9, 2015 04:37
-
-
Save jeffskelton3/597b278e9e58fb3cf379 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.use(function(req, res, next) { | |
var schema = req.headers['x-forwarded-proto']; | |
if (schema === 'https') { | |
next(); | |
} | |
else { | |
res.redirect('https://' + req.headers.host + req.url); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment