diff --git a/package.json b/package.json index 49e31ff629..2216badadd 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "node-imagemagick": "0.1.8", "gravatar": "1.0.6", "nconf": "~0.6.7", - "sitemap": "~0.6.0", + "sitemap": "~0.7.1", "request": "~2.25.0", "reds": "~0.2.4", "winston": "~0.7.2", diff --git a/src/sitemap.js b/src/sitemap.js index 5568944297..68e69ea6a0 100644 --- a/src/sitemap.js +++ b/src/sitemap.js @@ -45,6 +45,7 @@ var path = require('path'), var topicUrls = []; topics.getAllTopics(null, null, function(err, topics) { topics.forEach(function(topic) { + if (parseInt(topic.deleted, 10) !== 1) { topicUrls.push({ url: path.join('topic', topic.slug), diff --git a/src/webserver.js b/src/webserver.js index 591c66faa8..e0e4cdcf89 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -767,7 +767,8 @@ if(nconf.get('ssl')) { var sitemap = require('./sitemap.js'); sitemap.render(function (xml) { - res.type('xml').set('Content-Length', xml.length).send(xml); + res.header('Content-Type', 'application/xml'); + res.send( xml ); }); });