Use more reliable and cross server $_SERVER to retrieve the accepted content type

This commit is contained in:
Djamil Legato
2016-02-01 16:45:13 -08:00
parent 485df7517d
commit 1d08090560

View File

@@ -14,9 +14,7 @@ class Errors
{
$grav = Grav::instance();
$config = $grav['config']->get('system.errors');
$headers = @apache_request_headers();
$jsonRequest = $headers['Accept'] == 'application/json';
$jsonRequest = $_SERVER && $_SERVER['HTTP_ACCEPT'] && $_SERVER['HTTP_ACCEPT'] == 'application/json';
// Setup Whoops-based error handler
$whoops = new \Whoops\Run;