Artwork served without an image type is refused, so the podcast shows initials #279

Closed
opened 2026-10-17 14:05:30 -07:00 by rays · 1 comment
Owner

ipx refuses artwork whose Content-Type does not start with image/ (crates/ipx/src/web.rs:2121, not an image: {kind}), and /api/art answers 502. Some publishers send real images with no type or the wrong one. Browsers sniff these and show them; ipx does not.

Seen three times in 7 days:

  • 2026-10-17 15:25 UTC: https://d3t3ozftmdmh3i.cloudfront.net/staging/podcast_uploaded_nologo/45173075/bd0200b1beb6c0f6.jpg (Anchor/Spotify's CloudFront) is served as application/octet-stream. Its body starts ff d8 ff e0, which is a JPEG. Trace 760e9b1b336c3c4219880c2ea30f2a9b.
  • 2026-10-12 and 2026-10-15: https://assets.pippa.io/shows/60662d7d5b1ee164aa3e63dc/1617366398246-d4bfca6dfb747d4634f68de4f3c038e0.jpeg is served with no Content-Type at all. It is also a JPEG.

Query: {container="iPX"} |= "could not fetch artwork"

A fix: when the type is missing or application/octet-stream, check the first bytes for JPEG, PNG, GIF or WebP magic and use the type they show. Any other non-image type should still be refused.

ipx refuses artwork whose Content-Type does not start with `image/` (`crates/ipx/src/web.rs:2121`, `not an image: {kind}`), and /api/art answers 502. Some publishers send real images with no type or the wrong one. Browsers sniff these and show them; ipx does not. Seen three times in 7 days: - 2026-10-17 15:25 UTC: `https://d3t3ozftmdmh3i.cloudfront.net/staging/podcast_uploaded_nologo/45173075/bd0200b1beb6c0f6.jpg` (Anchor/Spotify's CloudFront) is served as `application/octet-stream`. Its body starts `ff d8 ff e0`, which is a JPEG. Trace 760e9b1b336c3c4219880c2ea30f2a9b. - 2026-10-12 and 2026-10-15: `https://assets.pippa.io/shows/60662d7d5b1ee164aa3e63dc/1617366398246-d4bfca6dfb747d4634f68de4f3c038e0.jpeg` is served with no Content-Type at all. It is also a JPEG. Query: `{container="iPX"} |= "could not fetch artwork"` A fix: when the type is missing or `application/octet-stream`, check the first bytes for JPEG, PNG, GIF or WebP magic and use the type they show. Any other non-image type should still be refused.
rays added the bug label 2026-10-17 14:05:30 -07:00
Author
Owner

Fixed in 36a820f: an answer with no Content-Type, or application/octet-stream, is read and its first bytes checked for JPEG, PNG, GIF or WebP; anything else, SVG included, is still refused. Deployed as 1.3.1-dev; both URLs above now come back 200 image/jpeg from /api/art.

Fixed in 36a820f: an answer with no Content-Type, or `application/octet-stream`, is read and its first bytes checked for JPEG, PNG, GIF or WebP; anything else, SVG included, is still refused. Deployed as 1.3.1-dev; both URLs above now come back 200 image/jpeg from /api/art.
rays closed this issue 2026-10-17 14:29:01 -07:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rays/ipx#279