0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-29 06:52:41 +00:00
Files
homebrewery/server/forcessl.mw.js
Trevor Buckner 0c70162a78 Revert "Merge branch 'master' of https://github.com/naturalcrit/homebrewery"
This reverts commit 077511dfa7, reversing
changes made to facbc5f6dc.
2019-01-22 11:23:35 -05:00

7 lines
232 B
JavaScript

module.exports = (req, res, next) => {
if(process.env.NODE_ENV === 'local') return next();
if(req.header('x-forwarded-proto') !== 'https') {
return res.redirect(302, `https://${req.get('Host')}${req.url}`);
}
return next();
};