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