summaryrefslogtreecommitdiff
path: root/_test/tests/inc/httpclient_http.test.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2013-08-02 13:44:33 +0200
committerAndreas Gohr <andi@splitbrain.org>2013-08-02 21:50:16 +0200
commit5b230a45afb9bb825ba148e699bdcbfc57957fb4 (patch)
treea99659b2af3fcfde08dbbe2a0a6d194c81083494 /_test/tests/inc/httpclient_http.test.php
parent18ce55ed82c3241469c3b29caef3a5c21c501d68 (diff)
downloadrpg-5b230a45afb9bb825ba148e699bdcbfc57957fb4.tar.gz
rpg-5b230a45afb9bb825ba148e699bdcbfc57957fb4.tar.bz2
HTTPClient don't pull too much bytes when no content-length is given
Diffstat (limited to '_test/tests/inc/httpclient_http.test.php')
-rw-r--r--_test/tests/inc/httpclient_http.test.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/_test/tests/inc/httpclient_http.test.php b/_test/tests/inc/httpclient_http.test.php
index 522f0790c..43dd4478f 100644
--- a/_test/tests/inc/httpclient_http.test.php
+++ b/_test/tests/inc/httpclient_http.test.php
@@ -122,9 +122,14 @@ class httpclient_http_test extends DokuWikiTest {
function test_maxbody(){
$http = new HTTPClient();
$http->max_bodysize = 250;
+
+ // this should abort completely
$data = $http->get($this->server.'/stream/30');
$this->assertTrue($data === false, 'HTTP response');
+
+ // this should read just the needed bytes
$http->max_bodysize_abort = false;
+ $http->keep_alive = false;
$data = $http->get($this->server.'/stream/30');
$this->assertFalse($data === false, 'HTTP response');
/* should read no more than max_bodysize+1 */