Merge pull request #87 from cjsewell/patch-1

Set Content-Type to 'application/json' for wildcard HTTP_ACCEPT
This commit is contained in:
Thierry François 2014-09-05 09:31:06 +03:00
commit 0cbbe2b1fc

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{