summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-04-12 16:17:49 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-04-12 16:17:49 +0200
commit62cce982bbd66c11ddb7867b516bc13f95eaf9a5 (patch)
treef784fb9a4b08e5091323ee2de74244c38d4a8add /lib
parente7fa2790f39a5c120d4f935139c1210258a1472a (diff)
downloadnextcloud-server-62cce982bbd66c11ddb7867b516bc13f95eaf9a5.tar.gz
nextcloud-server-62cce982bbd66c11ddb7867b516bc13f95eaf9a5.zip
default to GET request when no method is set to fix unittests, also set parsed json parameters on the post attribute
Diffstat (limited to 'lib')
-rw-r--r--lib/private/appframework/http/request.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/private/appframework/http/request.php b/lib/private/appframework/http/request.php
index 43631697d3a..643fa685adc 100644
--- a/lib/private/appframework/http/request.php
+++ b/lib/private/appframework/http/request.php
@@ -65,6 +65,10 @@ class Request implements \ArrayAccess, \Countable, IRequest {
$this->inputStream = $stream;
$this->items['params'] = array();
+ if(!array_key_exists('method', $vars)) {
+ $vars['method'] = 'GET';
+ }
+
foreach($this->allowedKeys as $name) {
$this->items[$name] = isset($vars[$name])
? $vars[$name]
@@ -76,6 +80,9 @@ class Request implements \ArrayAccess, \Countable, IRequest {
$params = json_decode(file_get_contents($this->inputStream), true);
if(count($params) > 0) {
$this->items['params'] = $params;
+ if($vars['method'] === 'POST') {
+ $this->items['post'] = $params;
+ }
}
// Handle application/x-www-form-urlencoded for methods other than GET
// or post correctly