mirror of
https://github.com/getgrav/grav.git
synced 2026-07-08 09:23:03 +02:00
Use more reliable and cross server $_SERVER to retrieve the accepted content type
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user