From f621513587789c49ef3caa512a7e53aeb7dc58ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Wed, 18 Oct 2023 10:58:24 +0800 Subject: [PATCH] eee --- Handler/OnRequest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Handler/OnRequest.php b/Handler/OnRequest.php index 90c02c9..027d8d0 100644 --- a/Handler/OnRequest.php +++ b/Handler/OnRequest.php @@ -132,9 +132,9 @@ class OnRequest implements OnRequestInterface ->withQueryParams($request->get ?? []) ->withParsedBody(function () use ($request) { $contentType = $request->header['content-type'] ?? 'application/json'; - if (str_contains($contentType, 'json')) { - return Json::decode($request->getContent()); - } else if (str_contains($contentType, 'xml')) { + if (\str_contains($contentType, 'json')) { + return \json_decode($request->getContent(),true); + } else if (\str_contains($contentType, 'xml')) { return Xml::toArray($request->getContent()); } else { return $request->post ?? [];