From 4fa14959d20eee0d9fb9e3cb793fc777e0f3aded Mon Sep 17 00:00:00 2001 From: John Caprez Date: Fri, 20 Nov 2020 17:02:09 +0100 Subject: [PATCH] fix "when" detection --- src/Routing/Middleware/CacheMiddleware.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Routing/Middleware/CacheMiddleware.php b/src/Routing/Middleware/CacheMiddleware.php index 439c447..8a5c1c6 100644 --- a/src/Routing/Middleware/CacheMiddleware.php +++ b/src/Routing/Middleware/CacheMiddleware.php @@ -54,7 +54,7 @@ public function __invoke(Request $request, Response $response, $next) { } /** @var callable $when */ $when = $this->getConfig('when'); - if ($when !== null && $when($request, $request) !== true) { + if ($when !== null && $when($request, $response) !== true) { return $next($request, $response); }