Use rest::http_content_type() instead of the header() method to set response content

This commit is contained in:
Tim Almdal 2008-11-20 17:51:12 +00:00
parent b78cee6395
commit 8c06908f7f
2 changed files with 3 additions and 3 deletions

View File

@ -118,12 +118,12 @@ class Comment_Core {
switch (rest::output_format()) {
case "xml":
header("Content-Type: application/xml");
rest::http_content_type(rest::XML);
return xml::to_xml($comments, array("comments", "comment"));
break;
case "json":
header("Content-Type: application/json");
rest::http_content_type(rest::JSON);
foreach ($comments as $comment) {
$data[] = $comment->as_array();
}

View File

@ -48,7 +48,7 @@ class Media_RSS_Controller extends Controller {
// @todo do we want to add an upload date to the items table?
$view->pub_date = date("D, d M Y H:i:s T");
header("Content-type: application/rss+xml");
rest::http_content_type(rest::RSS);
print $view;
}
}