Update request callback

This commit is contained in:
Alexander Pankratov 2019-06-09 17:43:32 +03:00
parent 76b5b67d96
commit 2f6e84562d
2 changed files with 1 additions and 1 deletions

View File

@ -116,6 +116,7 @@ class RequestCallback
if (!in_array($request->getClient()->getRemoteAddress(), $this->ipWhiteList, true)) { if (!in_array($request->getClient()->getRemoteAddress(), $this->ipWhiteList, true)) {
throw new \Exception('Requests from your IP is forbidden'); throw new \Exception('Requests from your IP is forbidden');
} }
$this->page['response'] = $this->callApi();
} catch (\Throwable $e) { } catch (\Throwable $e) {
$this->setError($e); $this->setError($e);
} }

View File

@ -39,7 +39,6 @@ class Server
$requestCallback = new RequestCallback($client, $request, $body); $requestCallback = new RequestCallback($client, $request, $body);
try { try {
$requestCallback->page['response'] = $requestCallback->callApi();
if ($requestCallback->page['response'] instanceof Promise) { if ($requestCallback->page['response'] instanceof Promise) {
$requestCallback->page['response'] = yield $requestCallback->page['response']; $requestCallback->page['response'] = yield $requestCallback->page['response'];
} }