Created
August 22, 2020 21:56
-
-
Save nathanoffline/5aad6a4eb5474bf0a890e3908030f4f6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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((req, res, next) => { | |
if (req.headers['x-forwarded-proto'] === 'http') | |
res.redirect(`https://${req.headers.host}${req.url}`); | |
else next(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment