round 3
This commit is contained in:
+3
-6
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user