Repository navigation
Conversation
The favicon download functions in lib/favicons.php only accepted a URL and destination path, so they never saw a feed's curl_params (e.g. a per-feed HTTP proxy or custom user agent). This meant favicons could fail to download for feeds that are only reachable through a proxy, even though the feed's own content was fetched correctly. Feed::faviconPrepare() now passes the feed's attributes() and curlOptions() through to download_favicon_from_image_url(), download_favicon() and searchFavicon(), matching the pattern already used elsewhere for feed content, e.g. Feed::loadJson() and the XPath loader. The on-demand p/f.php endpoint still can't apply per-feed proxy settings since it only has a favicon hash and the stored URL, with no live Feed object to read curl_params from; left a TODO there as a known follow-up rather than widening the scope of this fix.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8976
Changes proposed in this pull request:
lib/favicons.php(searchFavicon(),download_favicon(),download_favicon_from_image_url()) now accept the feed's HTTPattributesandcurl_options, and forward them toFreshRSS_http_Util::httpGet().Feed::faviconPrepare()passes$this->attributes()and$this->curlOptions()through, the same wayFeed::loadJson()and the XPath loader already do for regular feed content fetches.This means a feed configured with a per-feed proxy (or other
curl_params, such as a custom user agent or cookie) will now use that same configuration when FreshRSS downloads its favicon, instead of only using it for the feed content itself.Scope note: the on-demand
/p/f.phpendpoint (used to lazily (re)download a favicon on request) only has the favicon hash and a stored URL in a.txtfile, with no liveFeedobject to readcurl_paramsfrom. Applying per-feed proxy settings there would require persisting sanitizedcurl_optionsalongside that file, which felt like a bigger change than this bug warrants. I left a// TODOthere noting it as a known follow-up rather than bundling it into this fix.How to test the feature manually:
curl_params/ proxy address field).cli/actualize-user.phpor by re-adding the feed).Pull request checklist:
Additional information can be found in the documentation.