.../Drupal/Core/EventSubscriber/DefaultExceptionSubscriber.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionSubscriber.php index 4737e80..836b667 100644 --- a/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionSubscriber.php @@ -218,16 +218,6 @@ protected function getFormat(Request $request) { $format = 'json'; } - // Make an educated guess that any Accept header type that includes "json" - // can probably handle a generic JSON response for errors. As above, for - // any format this doesn't catch or that wants custom handling should - // register its own exception listener. - foreach ($request->getAcceptableContentTypes() as $mime) { - if (strpos($mime, 'html') === FALSE && strpos($mime, 'json') !== FALSE) { - $format = 'json'; - } - } - return $format; }