Skip to content

Commit

Permalink
BUGFIX: Prevent empty response
Browse files Browse the repository at this point in the history
In cases of non html responses like the `/sitemap.xml` the content stream was retrieved but then the pointer of the stream is already at the end.
This resulted in an empty broken response.
  • Loading branch information
Sebobo authored May 16, 2021
1 parent 0b7292c commit d630d51
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Classes/Aspect/CollectDebugInformationAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public function addDebugValues(JoinPointInterface $joinPoint)

if ($response instanceof Response) {
$output = $response->getBody()->getContents();
$response->getBody()->rewind();

if ($response->getHeader('Content-Type') !== 'text/html'
&& strpos($output, '<!DOCTYPE html>') === false) {
Expand Down

0 comments on commit d630d51

Please sign in to comment.