ErrorPage no longer generates HTML response for ajax requests

This commit is contained in:
Christopher Joe 2016-08-22 15:16:27 +12:00
parent ef46dee37f
commit c46490ea3a

View File

@ -24,6 +24,9 @@ class ErrorPageControllerExtension extends Extension {
* @throws SS_HTTPResponse_Exception
*/
public function onBeforeHTTPError($statusCode, $request) {
if (\Director::is_ajax()) {
return;
}
$response = ErrorPage::response_for($statusCode);
if($response) {
throw new SS_HTTPResponse_Exception($response, $statusCode);