alexdebril / feed-io

A PHP library to read and write feeds in JSONFeed, RSS or Atom format
https://alexdebril.github.io/feed-io/
MIT License
255 stars 53 forks source link

Improve handling of feeds when discover encounters feed links without protocol #405

Closed AccaliaDeElementia closed 1 year ago

AccaliaDeElementia commented 2 years ago

Some websites will omit the http/https protocol from links within the document, allowing the browser to request the feed via http or https depending on which protocol the page itself was fetched via.

The discover functionality of FeedIO does not apply a protocol to such links, but downstream consumers, such as Nextcloud news, will assume that discovered feeds include the protocol.

This commit alters FeedIO so that it assigns the https protocol to such discovered feeds that do not include the protocol in their link, allowing downstream consumers to maintain their assumption that discovered feeds will include a feed without breaking compatibility with the source feed, unless the source feed violates the assumption that a link href that omits the protocol can be fetched via either http or https, which is an assumption that should be out of scope for FeedIO, yes?

Signed-off-by: Accalia Accalia@Elementia.me

alexdebril commented 1 year ago

Thanks for this contribution and sorry I'm not reactive since a few months.

There's only one thing left to do after merging this pull request, it's to back-port your patch in the 4.9.x branch because next cloud uses feed-io 4.

I'm taking care of this