From 643208dff08dd065281055330a345a1f8e5a9a98 Mon Sep 17 00:00:00 2001 From: Diman <84639576+SuperErnD@users.noreply.github.com> Date: Fri, 26 Aug 2022 22:10:13 +0300 Subject: [PATCH] Add 405 errors for svcapi (#691) --- Web/Presenters/InternalAPIPresenter.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Web/Presenters/InternalAPIPresenter.php b/Web/Presenters/InternalAPIPresenter.php index 60c0b550..1a107659 100644 --- a/Web/Presenters/InternalAPIPresenter.php +++ b/Web/Presenters/InternalAPIPresenter.php @@ -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));