Update common.php

This commit is contained in:
qkqpttgf 2020-03-05 15:41:14 +08:00 committed by GitHub
parent ffb539316d
commit 7d0867ecb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -636,7 +636,7 @@ function main($path)
$header = [];
foreach (explode("\r\n", $response['header']) as $h) {
$a=explode(": ", $h);
if ($a[1]!='') $header[$a[0]] = $a[1];
if (isset($a[1])) $header[$a[0]] = $a[1];
}
//Content-Length: 387780
//Content-Range: bytes 0-387779/387780
@ -653,7 +653,13 @@ function main($path)
error_log('Range:'.$head['Content-Range'].' end:'.$e.' total:'.$t);
$s = $e+1;
if ($s==$t) $response['stat'] = 200;
ob_clean();
@ob_start();
$sendHeaders = array();
foreach ($head as $headerName => $headerVal) {
header($headerName . ': ' . $headerVal, true);
}
http_response_code($response['stat']);
echo $response['body'];
@ob_flush();
flush();