bnomei / kirby3-feed

Generate ATOM/JSON/RSS-Feed and XML-Sitemap from Pages-Collection
https://forum.getkirby.com/t/kirby3-feed-rss-json-sitemap/23574
MIT License
65 stars 8 forks source link

MIME type for RSS feed is wrong #4

Closed lukasbestle closed 6 years ago

lukasbestle commented 6 years ago

The MIME type for RSS feeds is application/rss+xml, which would need to be changed here:

https://github.com/bnomei/kirby3-feed/blob/e9a3d4be85e16d0aa5d54742dbc4be9d86051d37/config.php#L21

Currently your plugin detects XML-iness and not RSS-iness, so maybe you deliberately wanted to keep the MIME type broad. However I think it makes sense to be a bit more specific to ensure compatibility. It probably also makes sense to make the MIME type configurable instead of magically auto-detecting it from the snippet's output. Explicit configuration will have a better performance, be more flexible and also more robust. :)

PS: You don't need to send the Content-Type header from the snippets as you return a Response object from the page method. That will override the value from the snippet anyway.