@@ -152,8 +152,7 @@ private function getQuery(): ?string
152152 {
153153 // check if query is sent as raw http body in request as "application/json" or via post fields as "multipart/form-data"
154154 $ headers = apache_request_headers ();
155- if (array_key_exists ("Content-Type " , $ headers )
156- and in_array ($ headers ["Content-Type " ], ["application/json " , "application/json;charset=utf-8 " ])) {
155+ if (array_key_exists ("Content-Type " , $ headers ) and str_contains ($ headers ["Content-Type " ], "application/json " )) {
157156 // raw json string in http body
158157 $ phpInput = json_decode (file_get_contents ("php://input " ), true );
159158 return $ phpInput ["query " ] ?? null ;
@@ -172,7 +171,7 @@ private function getOperationName(): ?string
172171 {
173172 // check if query is sent as raw http body in request as "application/json" or via post fields as "multipart/form-data"
174173 $ headers = function_exists ("getallheaders " ) ? getallheaders () : [];
175- if (array_key_exists ("Content-Type " , $ headers ) and $ headers ["Content-Type " ] === "application/json " ) {
174+ if (array_key_exists ("Content-Type " , $ headers ) and str_contains ( $ headers ["Content-Type " ], "application/json " ) ) {
176175 // raw json string in http body
177176 $ phpInput = json_decode (file_get_contents ("php://input " ), true );
178177 return $ phpInput ["operationName " ] ?? null ;
@@ -191,7 +190,7 @@ private function getVariables(): array
191190 {
192191 // check if variables is sent as raw http body in request as "application/json" or via post fields as "multipart/form-data"
193192 $ headers = function_exists ("getallheaders " ) ? getallheaders () : [];
194- if (array_key_exists ("Content-Type " , $ headers ) and $ headers ["Content-Type " ] === "application/json " ) {
193+ if (array_key_exists ("Content-Type " , $ headers ) and str_contains ( $ headers ["Content-Type " ], "application/json " ) ) {
195194 // raw json string in http body
196195 $ phpInput = json_decode (file_get_contents ("php://input " ), true );
197196 return $ phpInput ["variables " ] ?? [];
0 commit comments