Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Incorrect Contant-Type header for RSS feeds

It should be application/rss+xml but not text/xml.
  • Loading branch information...
commit e249799e9a952e681dba39138cc2974db98b238f 1 parent accbd7f
Elvinas L. uniun authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 api/RSSFeed.php
6 api/RSSFeed.php
View
@@ -189,9 +189,11 @@ public function outputToBrowser() {
$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 @@ public function outputToBrowser() {
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);
Please sign in to comment.
Something went wrong with that request. Please try again.