From 08640b27d55f6382af6f08d0789b8109279ae825 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Tue, 19 Mar 2024 21:24:30 -0700 Subject: Ensure enclosure URLs are always absolute --- internal/reader/atom/atom_common.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'internal/reader/atom/atom_common.go') diff --git a/internal/reader/atom/atom_common.go b/internal/reader/atom/atom_common.go index debd46f1..945c5573 100644 --- a/internal/reader/atom/atom_common.go +++ b/internal/reader/atom/atom_common.go @@ -96,6 +96,21 @@ func (a AtomLinks) firstLinkWithRelationAndType(relation string, contentTypes .. return "" } +func (a AtomLinks) findAllLinksWithRelation(relation string) []*AtomLink { + var links []*AtomLink + + for _, link := range a { + if strings.EqualFold(link.Rel, relation) { + link.Href = strings.TrimSpace(link.Href) + if link.Href != "" { + links = append(links, link) + } + } + } + + return links +} + // The "atom:category" element conveys information about a category // associated with an entry or feed. This specification assigns no // meaning to the content (if any) of this element. -- cgit v1.2.3