diff options
author | Stanimir Bozhilov <stanimir@audriga.com> | 2022-09-21 15:31:50 +0200 |
---|---|---|
committer | Stanimir Bozhilov <stanimir@audriga.com> | 2022-09-21 15:31:50 +0200 |
commit | 0ace70488a02d7ee11cc3ae722c2e7f43f431d1e (patch) | |
tree | 34fb5a262a397f7f37efb237bf0a6dcd172ba177 /lib/private/AppFramework | |
parent | f7d51a39cfed94f90f5a526cb22e791a6fdc33d8 (diff) | |
download | nextcloud-server-0ace70488a02d7ee11cc3ae722c2e7f43f431d1e.tar.gz nextcloud-server-0ace70488a02d7ee11cc3ae722c2e7f43f431d1e.zip |
Treat application/json and application/scim+json in same if-block
Signed-off-by: Stanimir Bozhilov <stanimir@audriga.com>
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r-- | lib/private/AppFramework/Http/Request.php | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php index 9a7014b36c1..59ee3edd0fe 100644 --- a/lib/private/AppFramework/Http/Request.php +++ b/lib/private/AppFramework/Http/Request.php @@ -430,17 +430,9 @@ class Request implements \ArrayAccess, \Countable, IRequest { } $params = []; - // 'application/json' must be decoded manually. - if (strpos($this->getHeader('Content-Type'), 'application/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; - } - } - // 'application/scim+json' must be decoded manually. - } elseif (strpos($this->getHeader('Content-Type'), 'application/scim+json') !== false) { + // 'application/json' and 'application/scim+json' must be decoded manually. + if (strpos($this->getHeader('Content-Type'), 'application/json') !== false + || 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; |