MDL-65693 files: Honor http HEAD requests for files

This commit is contained in:
Brendan Heywood 2019-10-21 19:46:26 +11:00
parent 800563e415
commit d46dba32d4

View File

@ -2229,6 +2229,10 @@ function readfile_accel($file, $mimetype, $accelerate) {
header('Content-Length: '.$filesize);
if (!empty($_SERVER['REQUEST_METHOD']) and $_SERVER['REQUEST_METHOD'] === 'HEAD') {
exit;
}
if ($filesize > 10000000) {
// for large files try to flush and close all buffers to conserve memory
while(@ob_get_level()) {