Add 405 errors for svcapi (#691)

This commit is contained in:
Diman 2022-08-26 22:10:13 +03:00 committed by GitHub
parent e87cb2deac
commit 643208dff0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,9 +29,10 @@ final class InternalAPIPresenter extends OpenVKPresenter
function renderRoute(): void function renderRoute(): void
{ {
if($_SERVER["REQUEST_METHOD"] !== "POST") if($_SERVER["REQUEST_METHOD"] !== "POST") {
header("HTTP/1.1 405 Method Not Allowed");
exit("ты дебил это точка апи"); exit("ты дебил это точка апи");
}
try { try {
$input = (object) MessagePack::unpack(file_get_contents("php://input")); $input = (object) MessagePack::unpack(file_get_contents("php://input"));
} catch (\Exception $ex) { } catch (\Exception $ex) {
@ -71,9 +72,10 @@ final class InternalAPIPresenter extends OpenVKPresenter
} }
function renderTimezone() { function renderTimezone() {
if($_SERVER["REQUEST_METHOD"] !== "POST") if($_SERVER["REQUEST_METHOD"] !== "POST") {
header("HTTP/1.1 405 Method Not Allowed");
exit("ты дебил это метод апи"); exit("ты дебил это метод апи");
}
$sessionOffset = Session::i()->get("_timezoneOffset"); $sessionOffset = Session::i()->get("_timezoneOffset");
if(is_numeric($this->postParam("timezone", false))) { if(is_numeric($this->postParam("timezone", false))) {
$postTZ = intval($this->postParam("timezone", false)); $postTZ = intval($this->postParam("timezone", false));