summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2017-04-04 10:25:13 +0200
committerGitHub <noreply@github.com>2017-04-04 10:25:13 +0200
commit0d69b52fde739776242fdc0780c0e90d7faefa23 (patch)
tree6310af437a3ebced54a9cbb79369d9bc6a7428b9 /lib
parentc0972a26ed6737bcc9d0288f51c0371b98c81a61 (diff)
parent2a9192334eb6de56b55d5d9c1faab51ca2de2f9e (diff)
downloadnextcloud-server-0d69b52fde739776242fdc0780c0e90d7faefa23.tar.gz
nextcloud-server-0d69b52fde739776242fdc0780c0e90d7faefa23.zip
Merge pull request #4147 from nextcloud/fix_3890
Don't try to parse empty body if there is no body
Diffstat (limited to 'lib')
-rw-r--r--lib/private/AppFramework/Http/Request.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php
index fd43d468568..3f1e6fd951a 100644
--- a/lib/private/AppFramework/Http/Request.php
+++ b/lib/private/AppFramework/Http/Request.php
@@ -401,6 +401,8 @@ class Request implements \ArrayAccess, \Countable, IRequest {
protected function getContent() {
// If the content can't be parsed into an array then return a stream resource.
if ($this->method === 'PUT'
+ && $this->getHeader('Content-Length') !== 0
+ && $this->getHeader('Content-Length') !== null
&& strpos($this->getHeader('Content-Type'), 'application/x-www-form-urlencoded') === false
&& strpos($this->getHeader('Content-Type'), 'application/json') === false
) {