From 815785b667cab6e6c1ecb871abd3ba042d5eee59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 11 Aug 2023 18:28:55 +0800 Subject: [PATCH] qqq --- Handler/OnRequest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Handler/OnRequest.php b/Handler/OnRequest.php index 7b84dea..ca1b1e4 100644 --- a/Handler/OnRequest.php +++ b/Handler/OnRequest.php @@ -129,7 +129,9 @@ class OnRequest implements OnRequestInterface ->withQueryParams($request->get ?? []) ->withUploadedFiles($request->files ?? []) ->withMethod($request->getMethod()); - $contentType = $request->header['content-type']; + + var_dump($request->header); + $contentType = $request->header['content-type'] ?? 'application/json'; if (str_contains($contentType, 'json')) { $serverRequest->withParsedBody(json_decode($request->post, true)); } else if (str_contains($contentType, 'xml')) {