projects
/
websub-hub
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac22211
)
fix feed parser links to always be list
author
Justin Wind
<justin.wind+git@gmail.com>
Tue, 10 Aug 2021 22:33:46 +0000
(15:33 -0700)
committer
Justin Wind
<justin.wind+git@gmail.com>
Tue, 10 Aug 2021 22:33:46 +0000
(15:33 -0700)
src/link-helper.js
patch
|
blob
|
history
diff --git
a/src/link-helper.js
b/src/link-helper.js
index 0517dec6e6d73ba3d9986578e488b87289cbf1b4..5c6b83939f579b18491fc935c87fddd65a93131b 100644
(file)
--- 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) => {