Skip to content

Commit 88863a4

Browse files
committed
add support for utf-8 content type json in request
1 parent b4ba276 commit 88863a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Servers/Server.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ 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) and $headers["Content-Type"] === "application/json") {
155+
if (array_key_exists("Content-Type", $headers)
156+
and in_array($headers["Content-Type"], ["application/json", "application/json;charset=utf-8"])) {
156157
// raw json string in http body
157158
$phpInput = json_decode(file_get_contents("php://input"), true);
158159
return $phpInput["query"] ?? null;

0 commit comments

Comments
 (0)