Skip to content

Commit f1e77e6

Browse files
Fix compat with older composer
1 parent 7018918 commit f1e77e6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Downloader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ private function get(array $urls, bool $isRecipe = false, int $try = 3): array
313313
$this->rfs->download($urls, function ($url) use ($options, &$responses, &$retries, &$error) {
314314
try {
315315
$cacheKey = preg_replace('{[^a-z0-9.]}i', '-', $url);
316-
$json = $this->rfs->getContents($this->rfs::getOrigin($url), $url, false, $options[$url]);
316+
$origin = method_exists($this->rfs, 'getOrigin') ? $this->rfs::getOrigin($url) : parse_url($url, \PHP_URL_HOST);
317+
$json = $this->rfs->getContents($origin, $url, false, $options[$url]);
317318
if (200 === $this->rfs->findStatusCode($this->rfs->getLastHeaders())) {
318319
$responses[$url] = $this->parseJson($json, $url, $cacheKey, $this->rfs->getLastHeaders())->getBody();
319320
}

0 commit comments

Comments
 (0)