mirror of
https://github.com/flarum/framework.git
synced 2024-12-13 23:53:42 +08:00
Make JSON parameter middleware a bit more generic
This commit is contained in:
parent
00699b69da
commit
58b2b474d8
|
@ -11,7 +11,7 @@ class ReadJsonParameters implements MiddlewareInterface
|
||||||
*/
|
*/
|
||||||
public function __invoke(Request $request, Response $response, callable $out = null)
|
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);
|
$input = json_decode($request->getBody(), true);
|
||||||
|
|
||||||
foreach ($input as $name => $value) {
|
foreach ($input as $name => $value) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user