diff options
Diffstat (limited to 'lib/private/AppFramework/Http/Request.php')
-rw-r--r-- | lib/private/AppFramework/Http/Request.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php index 496a845dd4a..9a7014b36c1 100644 --- a/lib/private/AppFramework/Http/Request.php +++ b/lib/private/AppFramework/Http/Request.php @@ -26,6 +26,7 @@ declare(strict_types=1); * @author Thomas Tanghus <thomas@tanghus.net> * @author Vincent Petry <vincent@nextcloud.com> * @author Simon Leiner <simon@leiner.me> + * @author Stanimir Bozhilov <stanimir@audriga.com> * * @license AGPL-3.0 * @@ -404,6 +405,7 @@ class Request implements \ArrayAccess, \Countable, IRequest { && $this->getHeader('Content-Length') !== '' && strpos($this->getHeader('Content-Type'), 'application/x-www-form-urlencoded') === false && strpos($this->getHeader('Content-Type'), 'application/json') === false + && strpos($this->getHeader('Content-Type'), 'application/scim+json') === false ) { if ($this->content === false) { throw new \LogicException( @@ -437,6 +439,15 @@ class Request implements \ArrayAccess, \Countable, IRequest { $this->items['post'] = $params; } } + // 'application/scim+json' must be decoded manually. + } elseif (strpos($this->getHeader('Content-Type'), 'application/scim+json') !== false) { + $params = json_decode(file_get_contents($this->inputStream), true); + if ($params !== null && \count($params) > 0) { + $this->items['params'] = $params; + if ($this->method === 'POST') { + $this->items['post'] = $params; + } + } // Handle application/x-www-form-urlencoded for methods other than GET // or post correctly |