From: Justin Wind Date: Tue, 10 Aug 2021 22:33:46 +0000 (-0700) Subject: fix feed parser links to always be list X-Git-Tag: v1.1.2^2~3 X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=8608e06bddd511e1df62be64b484bc297f84d47b;p=websub-hub fix feed parser links to always be list --- diff --git a/src/link-helper.js b/src/link-helper.js index 0517dec..5c6b839 100644 --- a/src/link-helper.js +++ b/src/link-helper.js @@ -112,7 +112,11 @@ class LinkHelper { }); feedParser.on('meta', (meta) => { this.logger.debug(_scope, 'FeedParser meta', { meta }); - const feedLinks = meta['atom:link'] || []; + let feedLinks = meta['atom:link'] || []; + if (!Array.isArray(feedLinks)) { + // Parsing RSS seems to return a single entry for this rather than a list. + feedLinks = [feedLinks]; + } feedLinks .map((l) => l['@']) .forEach((l) => {