diff --git a/install/data/defaults.json b/install/data/defaults.json index 587167f662..391fb0178d 100644 --- a/install/data/defaults.json +++ b/install/data/defaults.json @@ -91,6 +91,7 @@ "userSearchResultsPerPage": 50, "maximumGroupNameLength": 255, "preventTopicDeleteAfterReplies": 0, + "feeds:disableSitemap": 0, "sitemapTopics": 500, "maintenanceMode": 0, "votesArePublic": 0, diff --git a/src/controllers/sitemap.js b/src/controllers/sitemap.js index 69d2df50c6..36dd89fba5 100644 --- a/src/controllers/sitemap.js +++ b/src/controllers/sitemap.js @@ -8,6 +8,9 @@ var meta = require('../meta'); var sitemapController = module.exports; sitemapController.render = function (req, res, next) { + if (meta.config['feeds:disableSitemap']) { + return setImmediate(next); + } async.waterfall([ function (next) { sitemap.render(next); @@ -38,7 +41,7 @@ sitemapController.getTopicPage = function (req, res, next) { function sendSitemap(method, res, callback) { if (meta.config['feeds:disableSitemap']) { - return callback(); + return setImmediate(callback); } async.waterfall([ function (next) {