Make JSON parameter middleware a bit more generic

This commit is contained in:
Franz Liedke 2015-06-03 02:04:00 +02:00
parent 00699b69da
commit 58b2b474d8

View File

@ -11,7 +11,7 @@ class ReadJsonParameters implements MiddlewareInterface
*/
public function __invoke(Request $request, Response $response, callable $out = null)
{
if (str_contains($request->getHeaderLine('content-type'), 'application/vnd.api+json')) {
if (str_contains($request->getHeaderLine('content-type'), 'json')) {
$input = json_decode($request->getBody(), true);
foreach ($input as $name => $value) {