Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
disabling JSONP from controllers and commenting out from expressjs co…
Browse files Browse the repository at this point in the history
…nfiguration, allowing users to enable if they need to
  • Loading branch information
lirantal committed Oct 14, 2014
1 parent f67b7d9 commit 6298e35
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions app/controllers/articles.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exports.create = function(req, res) {
message: errorHandler.getErrorMessage(err)
});
} else {
res.jsonp(article);
res.json(article);
}
});
};
Expand All @@ -30,7 +30,7 @@ exports.create = function(req, res) {
* Show the current article
*/
exports.read = function(req, res) {
res.jsonp(req.article);
res.json(req.article);
};

/**
Expand All @@ -47,7 +47,7 @@ exports.update = function(req, res) {
message: errorHandler.getErrorMessage(err)
});
} else {
res.jsonp(article);
res.json(article);
}
});
};
Expand All @@ -64,7 +64,7 @@ exports.delete = function(req, res) {
message: errorHandler.getErrorMessage(err)
});
} else {
res.jsonp(article);
res.json(article);
}
});
};
Expand All @@ -79,7 +79,7 @@ exports.list = function(req, res) {
message: errorHandler.getErrorMessage(err)
});
} else {
res.jsonp(articles);
res.json(articles);
}
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ exports.signup = function(req, res) {
if (err) {
res.status(400).send(err);
} else {
res.jsonp(user);
res.json(user);
}
});
}
Expand All @@ -62,7 +62,7 @@ exports.signin = function(req, res, next) {
if (err) {
res.status(400).send(err);
} else {
res.jsonp(user);
res.json(user);
}
});
}
Expand Down Expand Up @@ -197,7 +197,7 @@ exports.removeOAuthProvider = function(req, res, next) {
if (err) {
res.status(400).send(err);
} else {
res.jsonp(user);
res.json(user);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users/users.password.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ exports.reset = function(req, res, next) {
res.status(400).send(err);
} else {
// Return authenticated user
res.jsonp(user);
res.json(user);

done(err, user);
}
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/users/users.profile.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ exports.update = function(req, res) {
if (err) {
res.status(400).send(err);
} else {
res.jsonp(user);
res.json(user);
}
});
}
Expand All @@ -52,5 +52,5 @@ exports.update = function(req, res) {
* Send User
*/
exports.me = function(req, res) {
res.jsonp(req.user || null);
res.json(req.user || null);
};
4 changes: 2 additions & 2 deletions config/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ module.exports = function(db) {
app.use(bodyParser.json());
app.use(methodOverride());

// Enable jsonp
app.enable('jsonp callback');
// JSONP is disabled by default
// app.enable('jsonp callback');

// CookieParser should be above session
app.use(cookieParser());
Expand Down

0 comments on commit 6298e35

Please sign in to comment.