Replaced HTTPReponse settings of Content-type header with Content-Type, to match RestfulServer

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@70844 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-01-28 00:31:00 +00:00
parent f5b22dadff
commit 3131b476a6
2 changed files with 4 additions and 4 deletions

View File

@ -29,7 +29,7 @@ class XMLDataFormatter extends DataFormatter {
* @return String XML
*/
public function convertDataObject(DataObjectInterface $obj, $fields = null) {
Controller::curr()->getResponse()->addHeader("Content-type", "text/xml");
Controller::curr()->getResponse()->addHeader("Content-Type", "text/xml");
return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" . $this->convertDataObjectWithoutHeader($obj, $fields);
}
@ -111,7 +111,7 @@ class XMLDataFormatter extends DataFormatter {
* @return String XML
*/
public function convertDataObjectSet(DataObjectSet $set, $fields = null) {
Controller::curr()->getResponse()->addHeader("Content-type", "text/xml");
Controller::curr()->getResponse()->addHeader("Content-Type", "text/xml");
$className = $set->class;
$xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";

View File

@ -112,7 +112,7 @@ class ContentNegotiator {
// Only serve "pure" XHTML if the XML header is present
if(substr($content,0,5) == '<' . '?xml' ) {
$response->addHeader("Content-type", "application/xhtml+xml; charset=" . self::$encoding);
$response->addHeader("Content-Type", "application/xhtml+xml; charset=" . self::$encoding);
$response->addHeader("Vary" , "Accept");
$content = str_replace('&nbsp;','&#160;', $content);
@ -134,7 +134,7 @@ class ContentNegotiator {
* Removes "xmlns" attributes and any <?xml> Pragmas.
*/
function html(HTTPResponse $response) {
$response->addHeader("Content-type", "text/html; charset=" . self::$encoding);
$response->addHeader("Content-Type", "text/html; charset=" . self::$encoding);
$response->addHeader("Vary", "Accept");
$content = $response->getBody();