Artwork served without an image type is refused, so the podcast shows initials #279
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
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:
https://d3t3ozftmdmh3i.cloudfront.net/staging/podcast_uploaded_nologo/45173075/bd0200b1beb6c0f6.jpg(Anchor/Spotify's CloudFront) is served asapplication/octet-stream. Its body startsff d8 ff e0, which is a JPEG. Trace 760e9b1b336c3c4219880c2ea30f2a9b.https://assets.pippa.io/shows/60662d7d5b1ee164aa3e63dc/1617366398246-d4bfca6dfb747d4634f68de4f3c038e0.jpegis 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.Fixed in
36a820f: an answer with no Content-Type, orapplication/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.