diff --git a/Classes/Controller/ActionController.php b/Classes/Controller/ActionController.php index 301daaa..02a78e6 100644 --- a/Classes/Controller/ActionController.php +++ b/Classes/Controller/ActionController.php @@ -662,10 +662,9 @@ class ActionController extends BaseController } else { $this->response->setStatus($this->responseStatus); } - $this->response->setHeader( - 'Content-type', - 'application/json' - ); + if ($this->pageType == $this->ajaxPageType) { + $GLOBALS['TSFE']->setContentType('application/json'); + } unset($result['data']); if ($this->redirect) { $result['redirect'] = $this->redirect;