gzip enabled breaking in close()

This commit is contained in:
Andy Miller 2022-03-18 13:15:37 -06:00
parent 35d4d00429
commit 82015d4ae7
No known key found for this signature in database
GPG Key ID: 9F2CF38AEBDB0AE0

View File

@ -351,8 +351,9 @@ class Grav extends Container
*/
public function close(ResponseInterface $response): void
{
$gzip_enabled = (int) Grav::instance()['config']->get('system.cache.gzip');
// Make sure nothing extra gets written to the response.
while (ob_get_level()) {
while (ob_get_level() > 2 + $gzip_enabled) {
ob_end_clean();
}