v1.18.x
Barış Soner Uşaklı 7 years ago
parent 035c04212d
commit fa499aef18

@ -154,7 +154,9 @@ function generateForCategory(req, res, next) {
} }
var cid = req.params.category_id; var cid = req.params.category_id;
var category; var category;
if (!parseInt(cid, 10)) {
return next();
}
async.waterfall([ async.waterfall([
function (next) { function (next) {
async.parallel({ async.parallel({

@ -83,6 +83,14 @@ describe('feeds', function () {
}); });
}); });
it('should 404 if category id is not a number', function (done) {
request(nconf.get('url') + '/category/invalid.rss', function (err, res) {
assert.ifError(err);
assert.equal(res.statusCode, 404);
done();
});
});
it('should redirect if we do not have read privilege', function (done) { it('should redirect if we do not have read privilege', function (done) {
privileges.categories.rescind(['topics:read'], cid, 'guests', function (err) { privileges.categories.rescind(['topics:read'], cid, 'guests', function (err) {
assert.ifError(err); assert.ifError(err);

Loading…
Cancel
Save