Serve feeds as text/xml instead of application/rss+xml
Browsers (Firefox in particular) force-download application/rss+xml and application/atom+xml instead of rendering them, which is confusing for site visitors who click a feed link directly rather than pasting it into a reader. text/xml renders inline as an XML tree in every major browser. Feed readers (FreshRSS included) sniff the actual XML content to detect RSS/Atom, so this has no effect on subscription behavior. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+6
-1
@@ -54,7 +54,12 @@ function http_get(string $url, array $extraHeaders = []): string
|
||||
*/
|
||||
function serve_cached_feed(string $cacheKey, callable $builder): void
|
||||
{
|
||||
header('Content-Type: application/rss+xml; charset=utf-8');
|
||||
// text/xml plutot que application/rss+xml : les navigateurs affichent
|
||||
// ce type en ligne (arbre XML) au lieu de forcer un telechargement,
|
||||
// ce qui est plus rassurant pour un visiteur qui clique le lien
|
||||
// directement depuis le site. FreshRSS et les autres lecteurs RSS
|
||||
// detectent le format en lisant le contenu, pas ce header.
|
||||
header('Content-Type: text/xml; charset=utf-8');
|
||||
|
||||
if (!is_dir(CACHE_DIR)) {
|
||||
mkdir(CACHE_DIR, 0775, true);
|
||||
|
||||
Reference in New Issue
Block a user