Fixing Firefox RSS handling
This commit is contained in:
+1
-1
@@ -160,7 +160,7 @@ module.exports = (config) => {
|
|||||||
});
|
});
|
||||||
lastRSS = feed.xml();
|
lastRSS = feed.xml();
|
||||||
}
|
}
|
||||||
res.type('rss').send(lastRSS);
|
res.type(req.headers['user-agent'].match(/Mozilla/) ? 'xml' : 'rss').send(lastRSS);
|
||||||
} else {
|
} else {
|
||||||
showError(req.path, 404, res);
|
showError(req.path, 404, res);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ describe('Test RSS feed', () => {
|
|||||||
test('200 empty rss', (done) => {
|
test('200 empty rss', (done) => {
|
||||||
request(app).get('/rsstest').then((response) => {
|
request(app).get('/rsstest').then((response) => {
|
||||||
expect(response.statusCode).toBe(200);
|
expect(response.statusCode).toBe(200);
|
||||||
|
expect(response.type).toBe('application/rss+xml');
|
||||||
expect(response.text.length).toBeGreaterThan(0);
|
expect(response.text.length).toBeGreaterThan(0);
|
||||||
expect(response.text.split('<item>').length).toBe(1);
|
expect(response.text.split('<item>').length).toBe(1);
|
||||||
done();
|
done();
|
||||||
|
|||||||
Reference in New Issue
Block a user