Merge pull request #3285 from Icinga/bugfix/end-output-buffering-before-serving-images-3223

module/doc: End output buffering before serving module images
This commit is contained in:
lippserd 2018-01-18 15:25:07 +01:00 committed by GitHub
commit a59cf0b319
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);
}
}