Update webserver.js

Forgot this section - also use text/plain mimetype since we're not responding using XML to errors; if we're going to do that, we need to do it right in the first place.
v1.18.x
Damian Bushong 12 years ago
parent 93f040aea8
commit cec23817e2

@ -121,13 +121,11 @@ var express = require('express'),
if (tid.match('.rss')) {
fs.readFile('feeds/topics/' + tid, function (err, data) {
if (err) {
res.send("Unable to locate an rss feed at this location.");
res.type('text').send(404, "Unable to locate an rss feed at this location.");
return;
}
res.setHeader('Content-Type', 'application/xml');
res.setHeader('Content-Length', data.length);
res.end(data);
res.type('xml').set('Content-Length', data.length).send(data);
});
return;
}
@ -149,7 +147,7 @@ var express = require('express'),
if (cid.match('.rss')) {
fs.readFile('feeds/categories/' + cid, function (err, data) {
if (err) {
res.send(404, "Unable to locate an rss feed at this location.");
res.type('text').send(404, "Unable to locate an rss feed at this location.");
return;
}

Loading…
Cancel
Save