From 5b230a45afb9bb825ba148e699bdcbfc57957fb4 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 2 Aug 2013 13:44:33 +0200 Subject: HTTPClient don't pull too much bytes when no content-length is given --- _test/tests/inc/httpclient_http.test.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to '_test') 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 */ -- cgit v1.2.3