diff --git a/lib/Sapi.php b/lib/Sapi.php index dd49913..4101f82 100644 --- a/lib/Sapi.php +++ b/lib/Sapi.php @@ -88,7 +88,9 @@ static function sendResponse(ResponseInterface $response) { if ($contentLength !== null) { $output = fopen('php://output', 'wb'); if (is_resource($body) && get_resource_type($body) == 'stream') { - stream_copy_to_stream($body, $output, (int)$contentLength); + while (!feof($body)) { + fwrite($output,fread($body,8192)); + } } else { fwrite($output, $body, (int)$contentLength); }