Skip to content

Commit 69b8009

Browse files
authored
Update Http.php
1 parent 2f89ef9 commit 69b8009

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Protocols/Http.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,6 @@ public static function decode($recv_buffer, TcpConnection $connection)
175175
case 'application/x-www-form-urlencoded':
176176
parse_str($http_body, $_POST);
177177
break;
178-
case 'application/json':
179-
$_POST = json_decode($http_body, true);
180-
break;
181178
}
182179
}
183180
}
@@ -205,8 +202,13 @@ public static function decode($recv_buffer, TcpConnection $connection)
205202
$_SERVER['QUERY_STRING'] = '';
206203
}
207204

208-
// REQUEST
209-
$_REQUEST = array_merge($_GET, $_POST, $_REQUEST);
205+
if (is_array($_POST)) {
206+
// REQUEST
207+
$_REQUEST = array_merge($_GET, $_POST, $_REQUEST);
208+
} else {
209+
// REQUEST
210+
$_REQUEST = array_merge($_GET, $_REQUEST);
211+
}
210212

211213
// REMOTE_ADDR REMOTE_PORT
212214
$_SERVER['REMOTE_ADDR'] = $connection->getRemoteIp();

0 commit comments

Comments
 (0)