diff --git a/php/common.php b/php/common.php index 273eaf4..b9eb3ac 100644 --- a/php/common.php +++ b/php/common.php @@ -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); diff --git a/php/facebook.php b/php/facebook.php index 6c77afe..f594560 100644 --- a/php/facebook.php +++ b/php/facebook.php @@ -16,7 +16,8 @@ function fetch_facebook_feed(): string return http_get(FETCHRSS_URL, ['Accept: application/atom+xml, application/xml']); } -header('Content-Type: application/atom+xml; charset=utf-8'); +// text/xml plutot que application/atom+xml : voir la note dans common.php +header('Content-Type: text/xml; charset=utf-8'); if (!is_dir(CACHE_DIR)) { mkdir(CACHE_DIR, 0775, true);