mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
ErrorPage no longer generates HTML response for ajax requests
This commit is contained in:
parent
ef46dee37f
commit
c46490ea3a
@ -24,6 +24,9 @@ class ErrorPageControllerExtension extends Extension {
|
|||||||
* @throws SS_HTTPResponse_Exception
|
* @throws SS_HTTPResponse_Exception
|
||||||
*/
|
*/
|
||||||
public function onBeforeHTTPError($statusCode, $request) {
|
public function onBeforeHTTPError($statusCode, $request) {
|
||||||
|
if (\Director::is_ajax()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$response = ErrorPage::response_for($statusCode);
|
$response = ErrorPage::response_for($statusCode);
|
||||||
if($response) {
|
if($response) {
|
||||||
throw new SS_HTTPResponse_Exception($response, $statusCode);
|
throw new SS_HTTPResponse_Exception($response, $statusCode);
|
||||||
|
Loading…
Reference in New Issue
Block a user