mirror of
https://github.com/flarum/framework.git
synced 2024-12-11 21:43:38 +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)
|
||||
{
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user