Skip to content

Commit 5968aba

Browse files
committed
More tests
1 parent 1655777 commit 5968aba

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/Http/Middleware/CacheMiddleware.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ public function __construct(
2626
protected Driver $driver,
2727
protected int $ttl,
2828
protected ?string $cacheKey,
29-
protected bool $invalidate = false,
30-
) {
29+
protected bool $invalidate = false,
30+
)
31+
{
3132
//
3233
}
3334

@@ -53,7 +54,7 @@ public function __invoke(PendingRequest $pendingRequest): ?SimulatedResponsePayl
5354
// the SimulatedResponsePayload here.
5455

5556
if ($this->invalidate === false && $cachedResponse->hasNotExpired()) {
56-
$pendingRequest->middleware()->onResponse(fn (Response $response) => $response->setCached(true));
57+
$pendingRequest->middleware()->onResponse(fn(Response $response) => $response->setCached(true), true);
5758

5859
return $cachedResponse->getSimulatedResponsePayload();
5960
}

0 commit comments

Comments
 (0)