diff --git a/src/Downloader.php b/src/Downloader.php index 7e6d19020..772e6fcd1 100644 --- a/src/Downloader.php +++ b/src/Downloader.php @@ -85,6 +85,7 @@ private function fetchFile($filename, $cacheKey) while ($retries--) { try { $json = $this->rfs->getContents(self::ENDPOINT, $filename, false, $this->options); + return $this->parseJson($json, $filename, $cacheKey); } catch (\Exception $e) { if ($retries) { @@ -113,7 +114,7 @@ private function fetchFileIfLastModified($filename, $cacheKey, $lastModifiedTime try { $options['http']['header'][] = 'If-Modified-Since: '.$lastModifiedTime; $json = $this->rfs->getContents(self::ENDPOINT, $filename, false, $options); - if ($this->rfs->findStatusCode($this->rfs->getLastHeaders()) === 304) { + if (304 === $this->rfs->findStatusCode($this->rfs->getLastHeaders())) { return true; }