module/doc: End output buffering before serving module images

refs #3223
This commit is contained in:
Johannes Meyer 2018-01-18 10:35:07 +01:00
parent 226cc2c810
commit 94ea42f30d
1 changed files with 5 additions and 1 deletions

View File

@ -176,7 +176,11 @@ class ModuleController extends DocController
} else {
$finfo = new finfo();
$this->getResponse()
->setHeader('Content-Type', $finfo->file($imagePath, FILEINFO_MIME_TYPE));
->setHeader('Content-Type', $finfo->file($imagePath, FILEINFO_MIME_TYPE))
->setHeader('Content-Length', $imageInfo->getSize())
->sendHeaders();
ob_end_clean();
readfile($imagePath);
}
}