Slim now handles Content-Length correctly with HTTP streams

This commit is contained in:
Pierre Rudloff 2016-04-13 10:44:30 +02:00
parent f7577b9825
commit 63ec60b4ad
3 changed files with 10 additions and 9 deletions

View file

@ -264,7 +264,7 @@ class FrontController
$stream = $client->request('GET', $video->url, array('stream'=>true));
$response = $response->withHeader('Content-Disposition', 'attachment; filename="'.$video->_filename.'"');
$response = $response->withHeader('Content-Type', $stream->getHeader('Content-Type'));
//$response = $response->withHeader('Content-Length', $stream->getHeader('Content-Length'));
$response = $response->withHeader('Content-Length', $stream->getHeader('Content-Length'));
if ($request->isGet()) {
$response = $response->withBody($stream->getBody());
}