diff --git a/README.md b/README.md index 456326dd..a363fd0a 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Please note that this documentation contains the latest changes that may as of y ## Installation There are various ways to install and use this sdk. We'll elaborate on a couple here. -Note that the Parse PHP SDK requires PHP 5.4 or newer. +Note that the Parse PHP SDK requires PHP 5.4 or newer. It can also run on HHVM (recommended 3.0 or newer). ### Install with Composer diff --git a/package.json b/package.json index 671ba572..d2fa01ef 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,6 @@ "license": "SEE LICENSE IN LICENSE", "homepage": "https://github.com/montymxb/parse-server-test#readme", "dependencies": { - "parse-server-test": "1.3.4" + "parse-server-test": "1.3.5" } } diff --git a/src/Parse/ParseFile.php b/src/Parse/ParseFile.php index de9a7678..39409d04 100755 --- a/src/Parse/ParseFile.php +++ b/src/Parse/ParseFile.php @@ -252,7 +252,10 @@ private function download() if ($httpStatus > 399) { throw new ParseException('Download failed, file may have been deleted.', $httpStatus); } - $this->mimeType = $httpClient->getResponseContentType(); + $mimeType = $httpClient->getResponseContentType(); + if (isset($mimeType) && $mimeType !== 'null') { + $this->mimeType = $mimeType; + } $this->data = $response; return $response; diff --git a/tests/Parse/ParseFileTest.php b/tests/Parse/ParseFileTest.php index fd4926f1..987a6ffc 100644 --- a/tests/Parse/ParseFileTest.php +++ b/tests/Parse/ParseFileTest.php @@ -146,7 +146,12 @@ public function testParseFileTypes() $this->assertEquals($contents, $file3Again->getData()); // check mime types after calling getData - $this->assertEquals('application/octet-stream', $fileAgain->getMimeType()); + $mt = $fileAgain->getMimeType(); + // both of the following are acceptable for a response from a submitted mime type of unknown/unknown + $this->assertTrue( + $mt === 'application/octet-stream' || // parse-server < 2.7.0 + $mt === 'unknown/unknown' // parse-server >= 2.7.0, unknown mime type response change + ); $this->assertEquals('image/png', $file2Again->getMimeType()); $this->assertEquals('image/png', $file3Again->getMimeType()); }