Files
fleet/website/api/controllers
262234f5ac Fix fleetdm.com RSS feed to pass W3C Feed Validator (#42068)
## Summary

Fixes all errors and warnings reported by the [W3C Feed Validation
Service](https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Ffleetdm.com%2Frss%2Farticles)
for the `/rss/articles` endpoint (and all other `/rss/:categoryName`
endpoints).

## Changes

Only one file modified: `website/api/controllers/download-rss-feed.js`

### Errors fixed
- **`lastBuildDate` not RFC-822 format**: Changed from `new
Date(Date.now())` (which produces JS `toString()` format like `Thu Mar
19 2026 14:45:30 GMT+0000 (Coordinated Universal Time)`) to `new
Date().toUTCString()` (which produces RFC-822 format like `Thu, 19 Mar
2026 14:45:30 GMT`)
- **`pubDate` not RFC-822 format** (431 occurrences): Changed from
`.toJSON()` (ISO 8601) to `.toUTCString()` (RFC-822)
- **Missing channel `<link>` element**: Added `<link>` element at the
channel level pointing to the category page

### Warnings fixed
- **Missing `guid` on items** (431 occurrences): Added `<guid
isPermaLink="true">` to each item using the article's permalink URL
- **Missing `atom:link` with `rel="self"`**: Added `xmlns:atom`
namespace to the `<rss>` element and an `<atom:link href="..."
rel="self" type="application/rss+xml"/>` element in the channel

### Additional fix
- Fixed a minor bug where the image `<link>` URL was missing a `/`
separator between the domain and category name (`fleetdm.comarticles` →
`fleetdm.com/articles`)

### Not addressed
- The "Invalid HTML: Named entity expected" warning about `&#39;`
entities in descriptions. This is produced by Lodash's `_.escape()`
which correctly escapes apostrophes for XML content. The `&#39;` entity
is valid XML — the validator flags it only in an HTML parsing context,
and it does not affect feed validity or reader interoperability.

---

Built for [Brock
Walters](https://fleetdm.slack.com/archives/C097P4TAPRR/p1773932018039599)
by [Kilo for Slack](https://kilo.ai/features/slack-integration)

---------

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Co-authored-by: Eric <eashaw@sailsjs.com>
2026-03-20 11:42:26 -05:00
..