Skip to content

[xExtension-ImageProxy] Proxy the poster images of videos - #563

Merged
Frenzie merged 1 commit into
FreshRSS:mainfrom
NopeCharon:imageproxy-video-poster
Oct 27, 2026
Merged

Frenzie merged 1 commit into
FreshRSS:mainfrom
NopeCharon:imageproxy-video-poster

Conversation

@NopeCharon

Copy link
Copy Markdown
Contributor

Summary

  • also proxy the poster attribute of <video> elements, which FreshRSS keeps when sanitising feed content but which the extension left pointing to the original server (only <img> src/srcset were rewritten)
  • keep the original URL in data-xextension-imageproxy-original-poster, like data-xextension-imageproxy-original-src, so that FreshRSS_Entry::content() still finds it when deciding whether to append the entry's thumbnail or enclosures
  • leave the video src untouched, since image proxies cannot serve videos
  • add a regression test to tests/ImageProxyTest.php, bump the extension version to 1.0.3 and add a changelog entry

Fixes #561

Validation

  • composer run-script test-image-proxy: the new test fails on main (Video posters must be proxied) and passes with the change (24 assertions)
  • ran the output through FreshRSS' lazyimg(), as index/normal.phtml does after the entry_before_display hook. The proxied poster is the one moved to data-original, and the original URL stays available:
<video controls="controls" preload="none" src="https://v.example/a.mp4" poster="../themes/icons/grey.gif" data-original="https://proxy.example/?url=https%3A%2F%2Fi.example%2Fp.jpg%3Fa%3D1%26b%3D2" data-xextension-imageproxy-original-poster="https://i.example/p.jpg?a=1&amp;b=2"></video>
  • composer run-script php-lint, phtml-lint, phpcs and phpstan (with ../FreshRSS), plus markdownlint-cli2 on the README

FreshRSS keeps the `poster` attribute of `<video>` elements when it
sanitises feed content, but the extension only rewrote the `src` and
`srcset` of `<img>` elements. The browser therefore loaded video posters
straight from the original server, bypassing the proxy, which users
with "Proxy HTTPS" enabled rely on to avoid connecting to third parties.

Rewrite `poster` with the same proxy URL logic as image sources, and
keep the original URL in `data-xextension-imageproxy-original-poster`,
so that FreshRSS still finds it when checking whether the entry's
thumbnail or enclosures are already part of the content. The video
`src` is left untouched, since image proxies cannot serve videos.
The rewritten `poster` keeps working with the lazy loading of FreshRSS,
which moves it to `data-original` when rendering.

Add a regression test, and bump the extension version to 1.0.3.

Fixes FreshRSS#561
@Frenzie
Frenzie merged commit 552ed87 into FreshRSS:main Oct 27, 2026
1 check passed
@Frenzie

Frenzie commented Oct 27, 2026

Copy link
Copy Markdown
Member

Thanks!

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.

[xExtension-ImageProxy] Video poster images are not proxied

2 participants