Repository navigation
[xExtension-ImageProxy] Proxy the poster images of videos - #563
Merged
Merged
Conversation
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
Member
|
Thanks! |
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.
Summary
posterattribute of<video>elements, which FreshRSS keeps when sanitising feed content but which the extension left pointing to the original server (only<img>src/srcsetwere rewritten)data-xextension-imageproxy-original-poster, likedata-xextension-imageproxy-original-src, so thatFreshRSS_Entry::content()still finds it when deciding whether to append the entry's thumbnail or enclosuressrcuntouched, since image proxies cannot serve videostests/ImageProxyTest.php, bump the extension version to 1.0.3 and add a changelog entryFixes #561
Validation
composer run-script test-image-proxy: the new test fails onmain(Video posters must be proxied) and passes with the change (24 assertions)lazyimg(), asindex/normal.phtmldoes after theentry_before_displayhook. The proxied poster is the one moved todata-original, and the original URL stays available:composer run-script php-lint,phtml-lint,phpcsandphpstan(with../FreshRSS), plusmarkdownlint-cli2on the README