mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-23 00:40:23 +01:00
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.
This commit is contained in:
@@ -121,13 +121,11 @@ var express = require('express'),
|
|||||||
if (tid.match('.rss')) {
|
if (tid.match('.rss')) {
|
||||||
fs.readFile('feeds/topics/' + tid, function (err, data) {
|
fs.readFile('feeds/topics/' + tid, function (err, data) {
|
||||||
if (err) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
res.setHeader('Content-Type', 'application/xml');
|
res.type('xml').set('Content-Length', data.length).send(data);
|
||||||
res.setHeader('Content-Length', data.length);
|
|
||||||
res.end(data);
|
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -149,7 +147,7 @@ var express = require('express'),
|
|||||||
if (cid.match('.rss')) {
|
if (cid.match('.rss')) {
|
||||||
fs.readFile('feeds/categories/' + cid, function (err, data) {
|
fs.readFile('feeds/categories/' + cid, function (err, data) {
|
||||||
if (err) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user