sitemap fix

This commit is contained in:
Baris Soner Usakli
2014-01-17 18:58:38 -05:00
parent c00bd0b8d0
commit dc27638ca8
3 changed files with 4 additions and 2 deletions

View File

@@ -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",

View File

@@ -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),

View File

@@ -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 );
});
});