Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit f9e7829

Browse files
committed
Merge pull request #222 from doublecompile/issue-221
SapiStreamEmitter only sends subsets if the unit is bytes
2 parents 5e72635 + 6e954b2 commit f9e7829

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Response/SapiStreamEmitter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function emit(ResponseInterface $response, $maxBufferLength = 8192)
4040

4141
$range = $this->parseContentRange($response->getHeaderLine('Content-Range'));
4242

43-
if (is_array($range)) {
43+
if (is_array($range) && $range[0] === 'bytes') {
4444
$this->emitBodyRange($range, $response, $maxBufferLength);
4545
return;
4646
}

test/Response/SapiStreamEmitterTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public function contentRangeProvider()
6363
return [
6464
['bytes 0-2/*', 'Hello world', 'Hel'],
6565
['bytes 3-6/*', 'Hello world', 'lo w'],
66+
['items 0-0/1', 'Hello world', 'Hello world'],
6667
];
6768
}
6869

0 commit comments

Comments
 (0)