Skip to content

Commit

Permalink
fix getContent so body content stream can be accessed on POST method
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Krasikov <klonishe@gmail.com>
  • Loading branch information
xklonx committed Oct 6, 2019
1 parent e20dbc0 commit 2cee680
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/private/AppFramework/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ public function getCookie(string $key) {
/**
* Returns the request body content.
*
* If the HTTP request method is PUT and the body
* If the HTTP request method is PUT or POST and the body
* not application/x-www-form-urlencoded or application/json a stream
* resource is returned, otherwise an array.
*
Expand All @@ -413,7 +413,7 @@ public function getCookie(string $key) {
*/
protected function getContent() {
// If the content can't be parsed into an array then return a stream resource.
if ($this->method === 'PUT'
if (($this->method === 'PUT' || $this->method === 'POST')
&& $this->getHeader('Content-Length') !== '0'
&& $this->getHeader('Content-Length') !== ''
&& strpos($this->getHeader('Content-Type'), 'application/x-www-form-urlencoded') === false
Expand Down

0 comments on commit 2cee680

Please sign in to comment.