Skip to content

Respect per-feed proxy settings when downloading favicons - #9033

Open
Elgeryy1 wants to merge 1 commit into
FreshRSS:edgefrom
Elgeryy1:8976-favicon-proxy-settings
Open

Elgeryy1 wants to merge 1 commit into
FreshRSS:edgefrom
Elgeryy1:8976-favicon-proxy-settings

Conversation

@Elgeryy1

Copy link
Copy Markdown
Contributor

Fixes #8976

Changes proposed in this pull request:

  • The favicon download functions in lib/favicons.php (searchFavicon(), download_favicon(), download_favicon_from_image_url()) now accept the feed's HTTP attributes and curl_options, and forward them to FreshRSS_http_Util::httpGet().
  • Feed::faviconPrepare() passes $this->attributes() and $this->curlOptions() through, the same way Feed::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.php endpoint (used to lazily (re)download a favicon on request) only has the favicon hash and a stored URL in a .txt file, with no live Feed object to read curl_params from. Applying per-feed proxy settings there would require persisting sanitized curl_options alongside that file, which felt like a bigger change than this bug warrants. I left a // TODO there noting it as a known follow-up rather than bundling it into this fix.

How to test the feature manually:

  1. Configure a feed with a proxy under its subscription settings (curl_params / proxy address field).
  2. Trigger a favicon refresh for that feed (e.g. via cli/actualize-user.php or by re-adding the feed).
  3. Confirm the favicon request goes out through the configured proxy.

Pull request checklist:

  • clear commit messages
  • code manually tested
  • unit tests written (no existing test infrastructure covers favicon downloading, which performs live HTTP/cURL calls)
  • documentation updated

Additional information can be found in the documentation.

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.
@Alkarex Alkarex added this to the 1.31.0 milestone Nov 9, 2026
@Alkarex Alkarex modified the milestones: 1.31.0, 1.32.0 Nov 23, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Favicons are not fetched by proxy set in feed settings

2 participants