From e249799e9a952e681dba39138cc2974db98b238f Mon Sep 17 00:00:00 2001 From: uniun Date: Tue, 5 Feb 2013 18:11:28 +0200 Subject: [PATCH] Incorrect Contant-Type header for RSS feeds It should be application/rss+xml but not text/xml. --- api/RSSFeed.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/RSSFeed.php b/api/RSSFeed.php index 163a93e2f..22acd3898 100644 --- a/api/RSSFeed.php +++ b/api/RSSFeed.php @@ -189,9 +189,11 @@ class RSSFeed extends ViewableData { $prevState = SSViewer::get_source_file_comments(); SSViewer::set_source_file_comments(false); + $response = Controller::curr()->getResponse(); + if(is_int($this->lastModified)) { HTTP::register_modification_timestamp($this->lastModified); - header('Last-Modified: ' . gmdate("D, d M Y H:i:s", $this->lastModified) . ' GMT'); + $response->addHeader("Last-Modified", gmdate("D, d M Y H:i:s", $this->lastModified) . ' GMT'); } if(!empty($this->etag)) { HTTP::register_etag($this->etag); @@ -199,7 +201,7 @@ class RSSFeed extends ViewableData { if(!headers_sent()) { HTTP::add_cache_headers(); - header("Content-type: text/xml"); + $response->addHeader("Content-Type", "application/rss+xml"); } SSViewer::set_source_file_comments($prevState);