ENHANCEMENT Setting proper text/javascript content-type in FormResponse so clientside ajax-handling knows how to deal with it.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@92530 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-11-21 02:31:16 +00:00
parent b930fbfe20
commit 9ecd35928c

View File

@ -77,8 +77,8 @@ class FormResponse {
return self::$non_ajax_content;
} else if(isset($_REQUEST['forceajax']) || Director::is_ajax()) {
ContentNegotiator::disable();
// TODO figure out a way to stay backwards-compatible with Ajax.Evaluator and still use the automatic evaluating of Prototype
//header("Content-type: text/javascript");
$response = Controller::curr()->getResponse();
$response->addHeader('Content-Type', 'text/javascript');
return self::get_javascript();
} elseif(!empty(self::$non_ajax_content)) {
return self::$non_ajax_content;