Skip to content

Commit

Permalink
Fix: Make sure the site contains a closing head tag
Browse files Browse the repository at this point in the history
Fix #9
  • Loading branch information
jonnitto authored May 30, 2022
1 parent bd9d924 commit f27bc7b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Classes/Service/CompressionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public function processResponse(ResponseInterface $response): ResponseInterface
{
$html = $response->getBody()->getContents();
$html = HtmlCompress::construct()->compress($html);
if (stripos($html, "</head><body") === false) {
$html = str_replace("<body", "</head><body", $html);
}
$response = $response->withBody(Utils::streamFor($html));

if (!$this->debugMode) {
Expand Down

0 comments on commit f27bc7b

Please sign in to comment.