Make node module's rss.xml controller return a response object with content-type set to xml

8.0.x
Katherine Bailey 2012-04-15 20:45:51 -07:00 committed by Larry Garfield
parent 1c6379e1db
commit 2961c4feee
1 changed files with 2 additions and 2 deletions

View File

@ -3,6 +3,7 @@
use Drupal\Core\Database\Query\AlterableInterface; use Drupal\Core\Database\Query\AlterableInterface;
use Drupal\Core\Database\Query\SelectExtender; use Drupal\Core\Database\Query\SelectExtender;
use Drupal\Core\Database\Query\SelectInterface; use Drupal\Core\Database\Query\SelectInterface;
use Symfony\Component\HttpFoundation\Response;
/** /**
* @file * @file
@ -2651,8 +2652,7 @@ function node_feed($nids = FALSE, $channel = array()) {
$output .= format_rss_channel($channel['title'], $channel['link'], $channel['description'], $items, $channel['language'], $channel_extras); $output .= format_rss_channel($channel['title'], $channel['link'], $channel['description'], $items, $channel['language'], $channel_extras);
$output .= "</rss>\n"; $output .= "</rss>\n";
drupal_add_http_header('Content-Type', 'application/rss+xml; charset=utf-8'); return new Response($output, 200, array('Content-Type' => 'application/rss+xml; charset=utf-8'));
print $output;
} }
/** /**