Bug 3771 - RSSyl plugin does not understand relative URL in item's <link> tag
Summary: RSSyl plugin does not understand relative URL in item's <link> tag
Status: NEW
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Plugins/RSSyl (show other bugs)
Version: 3.14.1
Hardware: All All
: P3 enhancement
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2017-02-13 09:31 UTC by andy-scull
Modified: 2017-02-16 08:45 UTC (History)
1 user (show)

See Also:


Attachments

Description andy-scull 2017-02-13 09:31:30 UTC
Hi, example feed is https://github.com/DFHack/dfhack/releases.atom

In CM, message shows :
DFHack 0.43.05-beta1
URL: /DFHack/dfhack/releases/tag/0.43.05-beta1

Copying link confirms that it is without domain. Viewing plain RSS content, I see that it IS provided in that exact form, without domain and protocol
Few others RSS readers (Thunderbird, firefox built-in rss reader) substitute root domain from RSS feed header (probably from rel="self" link tag?)
I suggest to add this function to RSSyl plugin - in case there's not protocol/domain in <link> tag of <entry> or <item> element, then substitute it with link/domain of parent rss feed

This is minor annoyance until you click on rss links often. Unfortunately, this is what I do and getting full link URL isn't easy as you have to type full rss feed domain and than append the link from CM :(
Comment 1 Andrej Kacian 2017-02-15 18:53:51 UTC
It would be nice to have something solid to determine the base URI. However, after a brief research, this particular github feed doesn't give us much to work with:

Atom specification[1] mentions that xml:base W3C recommendation[2] may be used to resolve such relative URIs.
The xml:base document mentions a "xml:base" element for this purpose, but your github feed does not contain this element.
It further mentions RFC3986[3] as fallback, but again, this does not give us anything concrete.

The ultimate fallback is mentioned on several places, to use the retrieval URI as a base URI, but
    https://github.com/DFHack/dfhack/releases.atom/DFHack/dfhack/releases/tag/0.43.05-beta1
doesn't look correct.

I'll be happy to add relative URI resolving to RSSyl, but I'm afraid it wouldn't help you in this particular case anyway.

The base URI in this case is obviously "https://github.com", but the feed doesn't bother to specify it in any way, so whatever guesswork we add based on this feed might not work at all on the next feed.


1. http://atomenabled.org/developers/syndication/#whatIsAtom
2. https://www.w3.org/TR/xmlbase/
3. https://tools.ietf.org/html/rfc3986
Comment 2 andy-scull 2017-02-16 08:45:07 UTC
Why not use web addressing logic?
If relative URL starts with / then it means that this link is relative to root domain of RSS feed address (https://github.com in this case)
If relative URL does not start with / nor with full URI (http(s)://whatever) then treat this URL as relative to current document we're parsing (full feed address itself)

Note You need to log in before you can comment on or make changes to this bug.