Set Content-Type to 'application/json' for wildcard HTTP_ACCEPT
The Content-Type HTTP header should be set to application/json if HTTP_ACCEPT has application/json or is */*
This commit is contained in:
parent
013a4fde7b
commit
4cc7da8b7e
|
@ -295,7 +295,7 @@ class GridFieldBulkUpload_Request extends RequestHandler
|
|||
*/
|
||||
protected function contentTypeNegotiation(&$response)
|
||||
{
|
||||
if (isset($_SERVER['HTTP_ACCEPT']) && (strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false))
|
||||
if (isset($_SERVER['HTTP_ACCEPT']) && ((strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false) || $_SERVER['HTTP_ACCEPT'] === '*/*' )) {
|
||||
{
|
||||
$response->addHeader('Content-Type', 'application/json');
|
||||
}else{
|
||||
|
|
Loading…
Reference in New Issue