Skip to content

Commit 2a5a50e

Browse files
committed
remove unnecessary assertions from getPostData
1 parent 0eb2ea1 commit 2a5a50e

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

resources/lib/UnityHTTPD.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,6 @@ public static function errorHandler(int $severity, string $message, string $file
230230

231231
public static function getPostData(string $key): string
232232
{
233-
if (!array_key_exists("REQUEST_METHOD", $_SERVER)) {
234-
throw new RuntimeException('$_SERVER has no array key "REQUEST_METHOD"');
235-
}
236-
if ($_SERVER["REQUEST_METHOD"] !== "POST") {
237-
self::badRequest('$_SERVER["REQUEST_METHOD"] != "POST"');
238-
}
239233
if (!array_key_exists($key, $_POST)) {
240234
self::badRequest("\$_POST has no array key '$key'");
241235
}

0 commit comments

Comments
 (0)