Skip to content
Permalink
Browse files

Fix plugin assets not being served by AssetFilter when using FastCGI.

Reponse::send() calls fastcgi_finish_request() which prevents
the output from readfile() being sent to client. Refs #4597
  • Loading branch information...
ADmad committed Sep 18, 2014
1 parent 0ad4219 commit 0cd96a6f5941a419c85e90fb1ebfc49d8629b104
Showing with 1 addition and 3 deletions.
  1. +1 −3 src/Routing/Filter/AssetFilter.php
@@ -104,7 +104,6 @@ protected function _getAssetFile($url) {
* @return void
*/
protected function _deliverAsset(Request $request, Response $response, $assetFile, $ext) {
ob_start();
$compressionEnabled = $response->compress();
if ($response->type($ext) === $ext) {
$contentType = 'application/octet-stream';
@@ -118,8 +117,7 @@ protected function _deliverAsset(Request $request, Response $response, $assetFil
$response->header('Content-Length', filesize($assetFile));
}
$response->cache(filemtime($assetFile));
$response->send();
ob_clean();
$response->sendHeaders();
readfile($assetFile);
if ($compressionEnabled) {
ob_end_flush();

0 comments on commit 0cd96a6

Please sign in to comment.
You can’t perform that action at this time.