From 9ecd35928c413e8fb7121a7bb1073e7d420ed9ec Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 21 Nov 2009 02:31:16 +0000 Subject: [PATCH] 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 --- core/control/FormResponse.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/control/FormResponse.php b/core/control/FormResponse.php index 4ffc9971c..1490b1420 100755 --- a/core/control/FormResponse.php +++ b/core/control/FormResponse.php @@ -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;