mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Add support for application/scim+json content type
Signed-off-by: Stanimir Bozhilov <stanimir@audriga.com>
This commit is contained in:
parent
3950deb42f
commit
f0dbe1148a
1 changed files with 11 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue