Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ENHANCEMENT Setting proper text/javascript content-type in FormRespon…

…se 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
  • Loading branch information...
commit 9ecd35928c413e8fb7121a7bb1073e7d420ed9ec 1 parent b930fbf
@chillu chillu authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 core/control/FormResponse.php
View
4 core/control/FormResponse.php
@@ -77,8 +77,8 @@ static function respond() {
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;
Please sign in to comment.
Something went wrong with that request. Please try again.