mirror of
https://github.com/danog/TelegramApiServer.git
synced 2024-11-26 20:04:45 +01:00
Update request callback
This commit is contained in:
parent
76b5b67d96
commit
2f6e84562d
@ -116,6 +116,7 @@ class RequestCallback
|
||||
if (!in_array($request->getClient()->getRemoteAddress(), $this->ipWhiteList, true)) {
|
||||
throw new \Exception('Requests from your IP is forbidden');
|
||||
}
|
||||
$this->page['response'] = $this->callApi();
|
||||
} catch (\Throwable $e) {
|
||||
$this->setError($e);
|
||||
}
|
||||
|
@ -39,7 +39,6 @@ class Server
|
||||
$requestCallback = new RequestCallback($client, $request, $body);
|
||||
|
||||
try {
|
||||
$requestCallback->page['response'] = $requestCallback->callApi();
|
||||
if ($requestCallback->page['response'] instanceof Promise) {
|
||||
$requestCallback->page['response'] = yield $requestCallback->page['response'];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user