From 58241d6fe853cdb76e46ab917af0f5ecec57cd52 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 8 Apr 2022 23:08:44 +1200 Subject: [PATCH] Check content type header exists before checking its type --- src/Appwrite/GraphQL/Builder.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/GraphQL/Builder.php b/src/Appwrite/GraphQL/Builder.php index 433d28ae52..cbbac3bfed 100644 --- a/src/Appwrite/GraphQL/Builder.php +++ b/src/Appwrite/GraphQL/Builder.php @@ -498,7 +498,8 @@ class Builder $swooleRq = $request->getSwoole(); $swooleRq->post = $args; // Drop json content type so post args are used directly - if ($swooleRq->header['content-type'] === 'application/json') { + if (\array_key_exists('content-type', $swooleRq->header) + && $swooleRq->header['content-type'] === 'application/json') { unset($swooleRq->header['content-type']); } $request = new Request($swooleRq);