File tree Expand file tree Collapse file tree 2 files changed +8
-269
lines changed
Expand file tree Collapse file tree 2 files changed +8
-269
lines changed Original file line number Diff line number Diff line change @@ -201,7 +201,7 @@ public function getIsCacheableResponse(Response $response): bool
201201 return false ;
202202 }
203203
204- return $ this ->getIsHtmlResponseFormat ()
204+ return $ this ->getIsHtmlResponseFormat ($ response )
205205 || Blitz::$ plugin ->settings ->cacheNonHtmlResponses ;
206206 }
207207
@@ -759,9 +759,11 @@ private function addCraftHeaders(Response $response): void
759759 }
760760 }
761761
762- private function getIsHtmlResponseFormat (): bool
762+ private function getIsHtmlResponseFormat (? Response $ response = null ): bool
763763 {
764- return in_array (Craft::$ app ->getResponse ()->format , [
764+ $ response = $ response ?? Craft::$ app ->getResponse ();
765+
766+ return in_array ($ response ->format , [
765767 Response::FORMAT_HTML ,
766768 TemplateResponseFormatter::FORMAT ,
767769 ]);
You can’t perform that action at this time.
0 commit comments