diff --git a/src/CachedResponseClient.php b/src/CachedResponseClient.php index 01ea09d..26cef33 100644 --- a/src/CachedResponseClient.php +++ b/src/CachedResponseClient.php @@ -76,7 +76,7 @@ public function sendRequest(RequestInterface $request): ResponseInterface $file = sprintf('%s/%s_%s', $this->cacheDir, $host, sha1($cacheKey)); if (is_file($file) && is_readable($file) && ($content = file_get_contents($file)) !== false) { - return new Response(200, [], Stream::create(unserialize($content))); + return new Response(200, [], Stream::create(unserialize(trim($content)))); } $response = $this->delegate->sendRequest($request);