This commit is contained in:
Tyler Renelle
2012-10-12 08:19:13 -04:00
parent f11943349a
commit c596e897ff
2 changed files with 7 additions and 12 deletions
+3 -6
View File
@@ -36,12 +36,6 @@ server = http.createServer(expressApp);
module.exports = server;
if (process.env.NODE_ENV === 'production' && req.headers['x-forwarded-proto'] !== 'https') {
expressApp.get('*', function(req, res, next) {
return res.redirect('https://' + req.headers.host + req.url);
});
}
derby.use(require('racer-db-mongo'));
store = derby.createStore({
@@ -66,6 +60,9 @@ publicPath = path.join(root, 'public');
habitrpgMiddleware = function(req, res, next) {
var model;
if (req.headers['x-forwarded-proto'] !== 'https') {
res.redirect('https://' + req.headers.host + req.url);
}
model = req.getModel();
model.set('_mobileDevice', /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(req.header('User-Agent')));
auth.setRequest(req);