mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix(RSS Read Node): Fix issue where some feeds fail to load (#16001)
This commit is contained in:
@@ -29,7 +29,7 @@ export class RssFeedRead implements INodeType {
|
||||
icon: 'fa:rss',
|
||||
iconColor: 'orange-red',
|
||||
group: ['input'],
|
||||
version: [1, 1.1],
|
||||
version: [1, 1.1, 1.2],
|
||||
description: 'Reads data from an RSS Feed',
|
||||
defaults: {
|
||||
name: 'RSS Read',
|
||||
@@ -98,11 +98,20 @@ export class RssFeedRead implements INodeType {
|
||||
});
|
||||
}
|
||||
|
||||
const parser = new Parser({
|
||||
const parserOptions: IDataObject = {
|
||||
requestOptions: {
|
||||
rejectUnauthorized: !ignoreSSL,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
if (nodeVersion >= 1.2) {
|
||||
parserOptions.headers = {
|
||||
Accept:
|
||||
'application/rss+xml, application/rdf+xml;q=0.8, application/atom+xml;q=0.6, application/xml;q=0.4, text/xml;q=0.4',
|
||||
};
|
||||
}
|
||||
|
||||
const parser = new Parser(parserOptions);
|
||||
|
||||
let feed: Parser.Output<IDataObject>;
|
||||
try {
|
||||
|
||||
@@ -7,6 +7,9 @@ const feed = `<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.o
|
||||
describe('Test RSS Feed Trigger Node', () => {
|
||||
beforeAll(() => {
|
||||
nock('https://lorem-rss.herokuapp.com').get('/feed?length=3').reply(200, feed);
|
||||
nock('https://fake-rss-feed.com')
|
||||
.get('/feed')
|
||||
.reply(200, feed, { 'Content-Type': 'application/xml; charset=utf-8' });
|
||||
});
|
||||
|
||||
new NodeTestHarness().setupTests();
|
||||
|
||||
@@ -3,21 +3,33 @@
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "e5fd1ef8-5528-4626-a523-7668969b2123",
|
||||
"id": "4d0527e8-1906-4c09-bbd7-fa3d88f13195",
|
||||
"name": "When clicking \"Execute Workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [880, 400]
|
||||
"position": [-200, -220]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"url": "https://lorem-rss.herokuapp.com/feed?length=3"
|
||||
"url": "https://lorem-rss.herokuapp.com/feed?length=3",
|
||||
"options": {}
|
||||
},
|
||||
"id": "9c40a026-fa38-4c91-a4a1-5332f762c3dd",
|
||||
"id": "bb54b66c-2c40-4ea2-a1ae-5fef2186e4bd",
|
||||
"name": "RSS Read",
|
||||
"type": "n8n-nodes-base.rssFeedRead",
|
||||
"typeVersion": 1,
|
||||
"position": [1080, 400]
|
||||
"position": [0, -220]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"url": "https://fake-rss-feed.com/feed",
|
||||
"options": {}
|
||||
},
|
||||
"type": "n8n-nodes-base.rssFeedRead",
|
||||
"typeVersion": 1.2,
|
||||
"position": [0, -40],
|
||||
"id": "9b67fdd9-23de-40ae-b477-cb121a4ed5c8",
|
||||
"name": "RSS Read1"
|
||||
}
|
||||
],
|
||||
"pinData": {
|
||||
@@ -61,6 +73,47 @@
|
||||
"isoDate": "2023-02-09T13:38:00.000Z"
|
||||
}
|
||||
}
|
||||
],
|
||||
"RSS Read1": [
|
||||
{
|
||||
"json": {
|
||||
"creator": "John Smith",
|
||||
"title": "Lorem ipsum 2023-02-09T13:40:00Z",
|
||||
"link": "http://example.com/test/1675950000",
|
||||
"pubDate": "Thu, 09 Feb 2023 13:40:00 GMT",
|
||||
"dc:creator": "John Smith",
|
||||
"content": "Fugiat excepteur exercitation tempor ut aute sunt pariatur veniam pariatur dolor.",
|
||||
"contentSnippet": "Fugiat excepteur exercitation tempor ut aute sunt pariatur veniam pariatur dolor.",
|
||||
"guid": "http://example.com/test/1675950000",
|
||||
"isoDate": "2023-02-09T13:40:00.000Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"creator": "John Smith",
|
||||
"title": "Lorem ipsum 2023-02-09T13:39:00Z",
|
||||
"link": "http://example.com/test/1675949940",
|
||||
"pubDate": "Thu, 09 Feb 2023 13:39:00 GMT",
|
||||
"dc:creator": "John Smith",
|
||||
"content": "Laboris quis nulla tempor eu ullamco est esse qui aute commodo aliqua occaecat.",
|
||||
"contentSnippet": "Laboris quis nulla tempor eu ullamco est esse qui aute commodo aliqua occaecat.",
|
||||
"guid": "http://example.com/test/1675949940",
|
||||
"isoDate": "2023-02-09T13:39:00.000Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"creator": "John Smith",
|
||||
"title": "Lorem ipsum 2023-02-09T13:38:00Z",
|
||||
"link": "http://example.com/test/1675949880",
|
||||
"pubDate": "Thu, 09 Feb 2023 13:38:00 GMT",
|
||||
"dc:creator": "John Smith",
|
||||
"content": "Irure labore dolor dolore sint aliquip eu anim aute anim et nulla adipisicing nostrud.",
|
||||
"contentSnippet": "Irure labore dolor dolore sint aliquip eu anim aute anim et nulla adipisicing nostrud.",
|
||||
"guid": "http://example.com/test/1675949880",
|
||||
"isoDate": "2023-02-09T13:38:00.000Z"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"connections": {
|
||||
@@ -71,17 +124,24 @@
|
||||
"node": "RSS Read",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "RSS Read1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"active": false,
|
||||
"settings": {},
|
||||
"versionId": "d0662c8d-35a5-424b-a55f-3a2baf4f860e",
|
||||
"id": "113",
|
||||
"meta": {
|
||||
"instanceId": "36203ea1ce3cef713fa25999bd9874ae26b9e4c2c3a90a365f2882a154d031d0"
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "9bb18c59-4606-4889-a2b0-40284952c604",
|
||||
"meta": {
|
||||
"instanceId": "0fa937d34dcabeff4bd6480d3b42cc95edf3bc20e6810819086ef1ce2623639d"
|
||||
},
|
||||
"id": "wWDle8xVd0Elxoa0",
|
||||
"tags": []
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user