Fix #1692 Remove Content-Length header on images (HTTP2 compat)

Content-Length header should be the body size after compression (if enabled) and not the size of the original body. In HTTP1.1 such invalid value is not problematic but in HTTP2 it prevents images to display.
This commit is contained in:
Damien Sorel 2022-08-20 17:05:11 +02:00 committed by Pierrick Le Gall
parent e909cb19bb
commit 1b66ca73f9

3
i.php
View file

@ -349,7 +349,6 @@ function send_derivative($expires)
{
header('Expires: '.gmdate('D, d M Y H:i:s', $expires).' GMT');
}
header('Content-length: '.$fstat['size']);
header('Connection: close');
$ctype="application/octet-stream";
@ -619,4 +618,4 @@ if ($logger->severity() >= Logger::DEBUG)
'mem_usage' => function_exists('memory_get_peak_usage') ? round( memory_get_peak_usage()/(1024*1024), 1) : '',
'timing' => $timing,
));
}
}