From 4b931409787b63423e0b68c4bd5ded99439af709 Mon Sep 17 00:00:00 2001 From: Dirk Bauer Date: Thu, 15 Sep 2022 15:31:39 +0200 Subject: [PATCH] Added timeout options to requests (fixes #69) --- src/EtherpadLite/Request.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/EtherpadLite/Request.php b/src/EtherpadLite/Request.php index 87f94cf..f2057b4 100644 --- a/src/EtherpadLite/Request.php +++ b/src/EtherpadLite/Request.php @@ -45,7 +45,10 @@ public function __construct(string $url, string $apiKey, string $method, $args = */ public function send(): ResponseInterface { - $client = new HttpClient(['base_uri' => $this->url]); + $client = new HttpClient([ + 'base_uri' => $this->url, + 'timeout' => $this->args['timeout'] ?? 0, + ]); return $client->get( $this->getUrlPath(),