Skip to content

fix(rss): emit accurate image enclosure MIME types - #100

Open
Daisuke134 wants to merge 1 commit into
profullstack:masterfrom
Daisuke134:fix/rss-enclosure-mime
Open

fix(rss): emit accurate image enclosure MIME types#100
Daisuke134 wants to merge 1 commit into
profullstack:masterfrom
Daisuke134:fix/rss-enclosure-mime

Conversation

@Daisuke134

Copy link
Copy Markdown

Problem

The live RSS feed labels every image enclosure as image/webp, including JPEG responses such as https://picsum.photos/seed/qrcms33zi8/1000/1250 (which resolves with content-type: image/jpeg). RSS 2.0 requires the enclosure type to be a standard MIME type: https://www.rssboard.org/rss-specification#ltenclosuregtSubelementOfLtitemgt

Fix

  • infer MIME types from known image URL extensions (jpg/jpeg, png, gif, webp, avif, svg)
  • omit the optional enclosure when a remote URL has no trustworthy type instead of asserting WebP
  • keep the existing image preview in the RSS description
  • add regression coverage for JPEG, WebP with query parameters, and extensionless URLs

Verification

  • pnpm test — 61/61 PASS
  • pnpm typecheck — PASS
  • pnpm lint — PASS with 5 pre-existing warnings
  • pnpm build — PASS (43/43 static pages)

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.

1 participant