Avoid magic numbers

This commit is contained in:
Pierre Rudloff 2020-07-05 11:22:55 +02:00
parent 32f0a5012c
commit b02e255cb4
3 changed files with 8 additions and 5 deletions

View file

@ -21,6 +21,7 @@ use Alltube\Stream\PlaylistArchiveStream;
use Alltube\Stream\YoutubeStream;
use Slim\Http\Request;
use Slim\Http\Response;
use Slim\Http\StatusCode;
use Slim\Http\Stream;
/**
@ -203,8 +204,8 @@ class DownloadController extends BaseController
$response = $response->withHeader('Content-Length', $stream->getHeader('Content-Length'));
$response = $response->withHeader('Accept-Ranges', $stream->getHeader('Accept-Ranges'));
$response = $response->withHeader('Content-Range', $stream->getHeader('Content-Range'));
if ($stream->getStatusCode() == 206) {
$response = $response->withStatus(206);
if ($stream->getStatusCode() == StatusCode::HTTP_PARTIAL_CONTENT) {
$response = $response->withStatus(StatusCode::HTTP_PARTIAL_CONTENT);
}
if (isset($this->video->downloader_options->http_chunk_size)) {