diff --git a/src/JsonSchema/Uri/Retrievers/Curl.php b/src/JsonSchema/Uri/Retrievers/Curl.php index cd8414f3..9b49bd56 100644 --- a/src/JsonSchema/Uri/Retrievers/Curl.php +++ b/src/JsonSchema/Uri/Retrievers/Curl.php @@ -68,7 +68,7 @@ private function fetchMessageBody($response) */ protected function fetchContentType($response) { - if (0 < preg_match("/Content-Type:(\V*)/ims", $response, $match)) { + if (0 < preg_match("/Content-Type:([^;]*)/ims", $response, $match)) { $this->contentType = trim($match[1]); return true; diff --git a/src/JsonSchema/Uri/Retrievers/FileGetContents.php b/src/JsonSchema/Uri/Retrievers/FileGetContents.php index f2e73c3b..8a0c6224 100644 --- a/src/JsonSchema/Uri/Retrievers/FileGetContents.php +++ b/src/JsonSchema/Uri/Retrievers/FileGetContents.php @@ -79,7 +79,7 @@ private function fetchContentType(array $headers) */ protected static function getContentTypeMatchInHeader($header) { - if (0 < preg_match("/Content-Type:(\V*)/ims", $header, $match)) { + if (0 < preg_match("/Content-Type:([^;]*)/ims", $header, $match)) { return trim($match[1]); }