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

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-03-29 16:09:45 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2017-04-04 09:22:33 +0300
commit2a9192334eb6de56b55d5d9c1faab51ca2de2f9e (patch)
treef863432996152ab86993e1d5523ab836db0df3ca /tests/lib
parent51bcb0bbe196a82f17ccd67022dcef3a4b7573c1 (diff)
Don't try to parse empty body if there is no body
Fixes #3890 If we do a put request without a body the current code still tries to read the body. This patch makes sure that we do not try to read the body if the content length is 0. See RFC 2616 Section 4.3 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/AppFramework/Http/RequestTest.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/lib/AppFramework/Http/RequestTest.php b/tests/lib/AppFramework/Http/RequestTest.php
index cc4bbee2d8d..f80bffcb480 100644
--- a/tests/lib/AppFramework/Http/RequestTest.php
+++ b/tests/lib/AppFramework/Http/RequestTest.php
@@ -305,7 +305,10 @@ class RequestTest extends \Test\TestCase {
$vars = array(
'put' => $data,
'method' => 'PUT',
- 'server' => array('CONTENT_TYPE' => 'image/png'),
+ 'server' => [
+ 'CONTENT_TYPE' => 'image/png',
+ 'CONTENT_LENGTH' => strlen($data)
+ ],
);
$request = new Request(