From 4d6258adeb4366a337efc12f2c0f14d64a02bb3b Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 15 Jul 2013 21:48:03 -0400 Subject: [PATCH] Correct off by one error. Refs #3914 --- lib/Cake/Network/CakeResponse.php | 2 +- lib/Cake/Test/Case/Network/CakeResponseTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Network/CakeResponse.php b/lib/Cake/Network/CakeResponse.php index 998734748..3cc4b6356 100644 --- a/lib/Cake/Network/CakeResponse.php +++ b/lib/Cake/Network/CakeResponse.php @@ -1350,7 +1350,7 @@ class CakeResponse { break; } if ($end && $offset + $bufferSize >= $end) { - $bufferSize = $end - $offset; + $bufferSize = $end - $offset + 1; } echo fread($file->handle, $bufferSize); if (!$compress) { diff --git a/lib/Cake/Test/Case/Network/CakeResponseTest.php b/lib/Cake/Test/Case/Network/CakeResponseTest.php index 598faa5b7..d2771ef57 100644 --- a/lib/Cake/Test/Case/Network/CakeResponseTest.php +++ b/lib/Cake/Test/Case/Network/CakeResponseTest.php @@ -1437,7 +1437,7 @@ class CakeResponseTest extends CakeTestCase { $result = $response->send(); $output = ob_get_clean(); $this->assertEquals(206, $response->statusCode()); - $this->assertEquals("is the test asset", $output); + $this->assertEquals("is the test asset ", $output); $this->assertTrue($result !== false); }