Skip to content

Commit e4bb94d

Browse files
authored
do not write a cache entry if there is no cache key
Writing to the cache with an empty key will fail with "failed to open stream: Is a directory", so do not try to do that.
1 parent 2597d0d commit e4bb94d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Downloader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ private function parseJson(string $json, string $url, string $cacheKey, array $l
293293
}
294294

295295
$response = new Response($data, $lastHeaders);
296-
if ($response->getHeader('last-modified')) {
296+
if ($response->getHeader('last-modified') && $cacheKey) {
297297
$this->cache->write($cacheKey, json_encode($response));
298298
}
299299

0 commit comments

Comments
 (0)