Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
markvaneijk committed Nov 13, 2024
1 parent 7536e42 commit 9ebf2da
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Middleware/StaticResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@ public function terminate(Request $request, $response): void
protected function shouldBeStatic(Request $request, $response): bool
{
return
$request->isMethod('GET') || $request->isMethod('HEAD') &&
$this->config->get('static.enabled') === true &&
$response->getStatusCode() == 200 &&
$this->config->get('static.enabled') === true;
(
$request->isMethod('GET') ||
// TTFB checkers use HEAD requests,
// therefore we treat them the same as GET
$request->isMethod('HEAD')
);
}

/**
Expand Down

0 comments on commit 9ebf2da

Please sign in to comment.