Correct off by one error.

Refs #3914
This commit is contained in:
mark_story 2013-07-15 21:48:03 -04:00
parent 8d542e0923
commit 4d6258adeb
2 changed files with 2 additions and 2 deletions

View file

@ -1350,7 +1350,7 @@ class CakeResponse {
break; break;
} }
if ($end && $offset + $bufferSize >= $end) { if ($end && $offset + $bufferSize >= $end) {
$bufferSize = $end - $offset; $bufferSize = $end - $offset + 1;
} }
echo fread($file->handle, $bufferSize); echo fread($file->handle, $bufferSize);
if (!$compress) { if (!$compress) {

View file

@ -1437,7 +1437,7 @@ class CakeResponseTest extends CakeTestCase {
$result = $response->send(); $result = $response->send();
$output = ob_get_clean(); $output = ob_get_clean();
$this->assertEquals(206, $response->statusCode()); $this->assertEquals(206, $response->statusCode());
$this->assertEquals("is the test asset", $output); $this->assertEquals("is the test asset ", $output);
$this->assertTrue($result !== false); $this->assertTrue($result !== false);
} }