minor random post-merge fixes
This commit is contained in:
11
app.js
11
app.js
@ -97,7 +97,7 @@ app.use(helmet.xssFilter());
|
||||
app.use(helmet.xframe());
|
||||
|
||||
var trusted = [
|
||||
'"self"',
|
||||
"'self'",
|
||||
'*.freecodecamp.com',
|
||||
'*.gstatic.com',
|
||||
"*.google-analytics.com",
|
||||
@ -113,15 +113,6 @@ var trusted = [
|
||||
"*.rafflecopter.com",
|
||||
"localhost:3001"
|
||||
];
|
||||
//TODO(Berks): conditionally add localhost domains to csp;
|
||||
/*var connectSrc;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
debug('Pushing');
|
||||
connectSrc = [''self'', 'ws://localhost:3001/'];
|
||||
} else {
|
||||
debug('Not');
|
||||
connectSrc = [];
|
||||
}*/
|
||||
|
||||
debug(trusted);
|
||||
app.use(helmet.contentSecurityPolicy({
|
||||
|
@ -34,7 +34,7 @@ exports.returnChallenge = function(req, res, next) {
|
||||
"Prove to mom that computers aren't just for games"
|
||||
];
|
||||
if (challengeNumber > 59) { challengeNumber = 0; }
|
||||
Challenge.find({}, function (err, c) {
|
||||
Challenge.find({}, null, { sort: { challengeNumber: 1 } }, function(err, c) {
|
||||
if (err) {
|
||||
debug('Challenge err: ', err);
|
||||
next(err);
|
||||
@ -52,4 +52,5 @@ exports.returnChallenge = function(req, res, next) {
|
||||
challenges: c
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
|
@ -134,7 +134,7 @@ exports.postEmailSignup = function(req, res, next) {
|
||||
*/
|
||||
|
||||
exports.getAccount = function(req, res) {
|
||||
Challenge.find({}, function (err, c) {
|
||||
Challenge.find({}, null, { sort: { challengeNumber: 1 } }, function(err, c) {
|
||||
if (err) {
|
||||
console.error('Challenge err: ', err);
|
||||
next(err);
|
||||
|
@ -1,3 +1,4 @@
|
||||
require('dotenv').load();
|
||||
var Challenge = require('../models/Challenge.js'),
|
||||
mongoose = require('mongoose'),
|
||||
secrets = require('../config/secrets'),
|
||||
|
Reference in New Issue
Block a user