sitemap fix

v1.18.x
Baris Soner Usakli 11 years ago
parent c00bd0b8d0
commit dc27638ca8

@ -30,7 +30,7 @@
"node-imagemagick": "0.1.8", "node-imagemagick": "0.1.8",
"gravatar": "1.0.6", "gravatar": "1.0.6",
"nconf": "~0.6.7", "nconf": "~0.6.7",
"sitemap": "~0.6.0", "sitemap": "~0.7.1",
"request": "~2.25.0", "request": "~2.25.0",
"reds": "~0.2.4", "reds": "~0.2.4",
"winston": "~0.7.2", "winston": "~0.7.2",

@ -45,6 +45,7 @@ var path = require('path'),
var topicUrls = []; var topicUrls = [];
topics.getAllTopics(null, null, function(err, topics) { topics.getAllTopics(null, null, function(err, topics) {
topics.forEach(function(topic) { topics.forEach(function(topic) {
if (parseInt(topic.deleted, 10) !== 1) { if (parseInt(topic.deleted, 10) !== 1) {
topicUrls.push({ topicUrls.push({
url: path.join('topic', topic.slug), url: path.join('topic', topic.slug),

@ -767,7 +767,8 @@ if(nconf.get('ssl')) {
var sitemap = require('./sitemap.js'); var sitemap = require('./sitemap.js');
sitemap.render(function (xml) { sitemap.render(function (xml) {
res.type('xml').set('Content-Length', xml.length).send(xml); res.header('Content-Type', 'application/xml');
res.send( xml );
}); });
}); });

Loading…
Cancel
Save