Using Node/Express in a Heroku hosted app. I have an http to https forwarding function, which had worked but no longer.
I had forwarding working with the following from my app.configure('production'
...:
app.configure('production', function() {
return app.use(function(req, res, next) {
if (req.header('x-forwarded-proto') !== 'https') {
return res.redirect("https://" + (req.header('host')) + req.url);
} else {
return next();
}
});
It worked, I was satisfied and moved on to implement Redis-to-go instead of MemoryStorage and then to implement csrf middleware. Both of those features are working but now I'm finding that I can access my app through http://...
whereas before that would have been caught and auto-forwarded to the https://...
and the friendly green padlock.
Any idea what could have gone sour in the interim?