Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKate Butler <kate@innocraft.com>2019-07-17 02:06:28 +0300
committerThomas Steur <tsteur@users.noreply.github.com>2019-07-17 02:06:28 +0300
commite3bd2c69dd891d4cb9713ab337e2b7197aa72901 (patch)
treef0995aeb25bce72c9d71104900b54ee97ccc0165 /tests/PHPUnit/Integration
parent417c91f446624043a078c5b2d3378decbb9d86cd (diff)
Fix GeoIP database download issues over HTTP2 (#14449)
Diffstat (limited to 'tests/PHPUnit/Integration')
-rw-r--r--tests/PHPUnit/Integration/HttpTest.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/PHPUnit/Integration/HttpTest.php b/tests/PHPUnit/Integration/HttpTest.php
index 29159bab65..d42eedcf0f 100644
--- a/tests/PHPUnit/Integration/HttpTest.php
+++ b/tests/PHPUnit/Integration/HttpTest.php
@@ -292,4 +292,29 @@ class HttpTest extends \PHPUnit_Framework_TestCase
$result = Http::sendHttpRequestBy('socket', 'https://piwik.org/', 10);
$this->assertNotEmpty($result);
}
+
+ /**
+ * @dataProvider getMethodsToTest
+ */
+ public function testHttpDownloadChunk_responseSizeLimitedToChunk($method)
+ {
+ $result = Http::sendHttpRequestBy(
+ $method,
+ 'https://tools.ietf.org/html/rfc7233',
+ 300,
+ null,
+ null,
+ null,
+ 0,
+ '',
+ false,
+ array(0, 50)
+ );
+ /**
+ * The last arg above asked the server to limit the response sent back to bytes 0->50.
+ * The RFC for HTTP Range Requests says that these headers can be ignored, so the test
+ * depends on a server that will respect it - we are requesting the RFC itself, which does.
+ */
+ $this->assertEquals(51, strlen($result));
+ }
}