diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-12 18:17:49 +0400 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-12 18:17:49 +0400 |
commit | 62cce982bbd66c11ddb7867b516bc13f95eaf9a5 (patch) | |
tree | f784fb9a4b08e5091323ee2de74244c38d4a8add /lib/private/appframework | |
parent | e7fa2790f39a5c120d4f935139c1210258a1472a (diff) |
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/private/appframework')
-rw-r--r-- | lib/private/appframework/http/request.php | 7 |
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 |