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:
Corey Sewell 2014-09-05 09:25:36 +12:00
parent 013a4fde7b
commit 4cc7da8b7e
1 changed files with 1 additions and 1 deletions

View File

@ -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{