Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ public function deliver(string $path_to_file, bool $file_marked_to_delete): void
* (mediatype = mimetype)
* as well as a boundry header to indicate the various chunks of data.
*/
$response = $this->httpService->response()->withHeader("Accept-Ranges", "0-$length");
$response = $this->httpService->response()->withHeader(ResponseHeader::ACCEPT_RANGES, 'bytes');
Comment thread
mBeym marked this conversation as resolved.
$this->httpService->saveResponse($response);
$server = $this->httpService->request()->getServerParams();
$is_partial = false;
// header('Accept-Ranges: bytes');
// multipart/byteranges
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.2
Expand Down Expand Up @@ -161,14 +162,18 @@ public function deliver(string $path_to_file, bool $file_marked_to_delete): void
$end = $c_end;
$length = $end - $start + 1; // Calculate new content length
fseek($fp, (int) $start);
$is_partial = true;

$response = $this->httpService->response()->withStatus(206);

$this->httpService->saveResponse($response);
} // fim do if

// Notify the client the byte range we'll be outputting
$response = $this->httpService->response()->withHeader(ResponseHeader::CONTENT_RANGE, "bytes $start-$end/$size")->withHeader(ResponseHeader::CONTENT_LENGTH, $length);
$response = $this->httpService->response()->withHeader(ResponseHeader::CONTENT_LENGTH, (string) $length);
if ($is_partial) {
$response = $response->withHeader(ResponseHeader::CONTENT_RANGE, "bytes $start-$end/$size");
}

$this->httpService->saveResponse($response);

Expand Down
Loading