diff --git a/CHANGELOG.md b/CHANGELOG.md index 7921a73e2..5c4ecf6c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Support for HAproxy protocol header in IMAP connections (#8625) - Change 'smtp_log' option default value to False - Delete messages directly from Junk on folder purge if delete_junk is enabled (#8766) +- Set timeout=30, connect_timeout=5, read_timeout=120 as defaults for HTTP client (#8865) - ACL: Set default of 'acl_specials' option to ['anyone'] (#8911) - Enigma: Support Kolab's Web Of Anti-Trust feature (#8626) - Managesieve: Support :encodeurl (RFC 5435) (#8917) diff --git a/config/defaults.inc.php b/config/defaults.inc.php index 1476990a7..5fc3c0229 100644 --- a/config/defaults.inc.php +++ b/config/defaults.inc.php @@ -844,7 +844,9 @@ $config['assets_dir'] = ''; // Options passed when creating Guzzle HTTP client, used to fetch remote content // For example: // [ -// 'timeout' => 10, +// 'timeout' => 30, +// 'connect_timeout' => 5, +// 'read_timeout' => 120, // 'proxy' => 'tcp://localhost:8125', // ] $config['http_client'] = []; diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php index 0554c7f54..67189f1cd 100644 --- a/program/lib/Roundcube/rcube.php +++ b/program/lib/Roundcube/rcube.php @@ -268,7 +268,9 @@ class rcube */ public function get_http_client($options = []) { - return new \GuzzleHttp\Client($options + $this->config->get('http_client')); + $defaults = ['timeout' => 30, 'connect_timeout' => 5, 'read_timeout' => 120]; + + return new \GuzzleHttp\Client($options + $this->config->get('http_client') + $defaults); } /**