ServerRequest parses request body when Content-type header includes expected values; allows for charset in header value.

This commit is contained in:
PJ Dietz 2015-11-08 19:31:43 -05:00
parent 977f89c50e
commit db7aaa2688
1 changed files with 3 additions and 2 deletions

View File

@ -360,8 +360,9 @@ class ServerRequest extends Request implements ServerRequestInterface
} }
$this->body = $this->getStreamForBody(); $this->body = $this->getStreamForBody();
$contentType = $this->getHeader("Content-type"); $contentType = $this->getHeaderLine("Content-type");
if ($contentType === ["application/x-www-form-urlencoded"] || $contentType === ["multipart/form-data"]) { if (strpos($contentType, "application/x-www-form-urlencoded") !== false
|| strpos($contentType, "multipart/form-data") !== false) {
$this->parsedBody = $_POST; $this->parsedBody = $_POST;
} }
} }