Search Content-Type header with regexp

This commit is contained in:
Willian
2014-10-09 18:34:44 -03:00
parent e3f8f75065
commit 600a2b0eba
+1 -1
View File
@@ -354,7 +354,7 @@ class Curl
$raw_response = $response;
if (isset($response_headers['Content-Type'])) {
if (in_array($response_headers['Content-Type'], array('application/json', 'application/vnd.api+json'))) {
if (preg_match('~^application/(?:json|vnd\.api\+json)~i', $response_headers['Content-Type'])) {
$json_obj = json_decode($response, false);
if ($json_obj !== null) {
$response = $json_obj;