@@ -152,8 +152,7 @@ private function getQuery(): ?string
152
152
{
153
153
// check if query is sent as raw http body in request as "application/json" or via post fields as "multipart/form-data"
154
154
$ 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 " )) {
157
156
// raw json string in http body
158
157
$ phpInput = json_decode (file_get_contents ("php://input " ), true );
159
158
return $ phpInput ["query " ] ?? null ;
@@ -172,7 +171,7 @@ private function getOperationName(): ?string
172
171
{
173
172
// check if query is sent as raw http body in request as "application/json" or via post fields as "multipart/form-data"
174
173
$ 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 " ) ) {
176
175
// raw json string in http body
177
176
$ phpInput = json_decode (file_get_contents ("php://input " ), true );
178
177
return $ phpInput ["operationName " ] ?? null ;
@@ -191,7 +190,7 @@ private function getVariables(): array
191
190
{
192
191
// check if variables is sent as raw http body in request as "application/json" or via post fields as "multipart/form-data"
193
192
$ 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 " ) ) {
195
194
// raw json string in http body
196
195
$ phpInput = json_decode (file_get_contents ("php://input " ), true );
197
196
return $ phpInput ["variables " ] ?? [];
0 commit comments