fix(gif): Giphy thumbnails blocked by CSP + posted GIFs render frozen (LC-507) #474
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/LC-507-gif-csp-and-autoplay"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes two GIF defects, both fallout from the LC-505 Tenor to Giphy migration. Root cause diagnosed for each before patching.
Bug 1: picker thumbnails blocked (broken-image icons)
The Giphy search proxy works (titles + "Powered by GIPHY" render), but every grid cell showed a broken image. Root cause: the CSP
img-srcdirective inserver/src/security_headers.rsstill allowed onlyhttps://tenor.com https://*.tenor.com. The picker grid hotlinks Giphy preview thumbnails frommedia.giphy.com, which CSP blocked. Not an API-key, rendition, or referrer issue. Fix: allowhttps://*.giphy.com(drop the dead Tenor entry), with a regression assertion inserver/tests/security_headers.rs.Bug 2: posted GIFs render frozen until clicked
Root cause:
uploads::pipeline::process_gifintentionally builds the preview rendition as a single still first frame, and the timeline rendered image attachments with?size=preview(server/templates/partials/attachment.html). So a posted GIF showed a frozen frame; the lightbox opened the animated original, which is why it animated on click.Decision: autoplay inline (Slack/Discord behavior). A GIF picker exists to post animated reactions and users expect motion; the GIFs are byte-capped and re-hosted same-origin. Fix: serve the animated original for
image/gifattachments in the timeline (newAttachment::is_gif()); all other images keep the still preview.Checks
just check,just test,just test-saasall pass.