fix: Fix stream download
guzzlehttp/psr7 1.6 does not accept empty headers
This commit is contained in:
parent
ee7c727f91
commit
5f5b0a5cf5
1 changed files with 7 additions and 1 deletions
|
@ -164,7 +164,13 @@ class DownloadController extends BaseController
|
|||
$response = $response->withHeader('Content-Type', 'video/'.$this->video->ext);
|
||||
$body = new Stream($this->video->getM3uStream());
|
||||
} else {
|
||||
$stream = $this->video->getHttpResponse(['Range' => $request->getHeader('Range')]);
|
||||
$range = $request->getHeader('Range');
|
||||
if (empty($range)) {
|
||||
$headers = [];
|
||||
} else {
|
||||
$headers = ['Range' => $range];
|
||||
}
|
||||
$stream = $this->video->getHttpResponse($headers);
|
||||
|
||||
$response = $response->withHeader('Content-Type', $stream->getHeader('Content-Type'));
|
||||
$response = $response->withHeader('Content-Length', $stream->getHeader('Content-Length'));
|
||||
|
|
Loading…
Reference in a new issue