Skip to content

Commit

Permalink
Merge pull request #3250 from kdambekalns/bugfix/handle-streams-of-un…
Browse files Browse the repository at this point in the history
…known-size

BUGFIX: Assume content exists, if stream size is unknown
  • Loading branch information
kdambekalns authored Dec 6, 2023
2 parents 028b804 + 7da588d commit 41eb01f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public static function makeStandardsCompliant(ResponseInterface $response, Reque
}
}

if (!$response->hasHeader('Content-Length')) {
if (!$response->hasHeader('Content-Length') && $response->getBody()->getSize() !== null) {
$response = $response->withHeader('Content-Length', $response->getBody()->getSize());
}

Expand Down
3 changes: 2 additions & 1 deletion Neos.Flow/Classes/Mvc/ActionResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ public function buildHttpResponse(): ResponseInterface
*/
private function hasContent(): bool
{
return $this->content->getSize() > 0;
$contentSize = $this->content->getSize();
return $contentSize === null || $contentSize > 0;
}
}

0 comments on commit 41eb01f

Please sign in to comment.