mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #1160 from uniun/patch-3
Incorrect Contant-Type header for RSS feeds
This commit is contained in:
commit
2b05951d41
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user