From 5848dbd206d2ca6047a857d623958c0354a0b11e Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Sat, 2 Mar 2024 11:06:23 +0100 Subject: [PATCH] feat: add trim() for unserialize() --- src/CachedResponseClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);