Add alternative json mimetype

I think it may be useful to decode JSON served under JSON API mimetype.
http://jsonapi.org/
This commit is contained in:
Willian
2014-10-09 09:42:14 -03:00
parent 884b9f29c6
commit e3f8f75065
+1 -1
View File
@@ -354,7 +354,7 @@ class Curl
$raw_response = $response;
if (isset($response_headers['Content-Type'])) {
if (stripos($response_headers['Content-Type'], 'application/json') === 0) {
if (in_array($response_headers['Content-Type'], array('application/json', 'application/vnd.api+json'))) {
$json_obj = json_decode($response, false);
if ($json_obj !== null) {
$response = $json_obj;