Set timeout=30, connect_timeout=5, read_timeout=120 as defaults for HTTP client (#8865)

This commit is contained in:
Aleksander Machniak
2023-04-10 09:46:54 +02:00
parent 0266f7a3bf
commit ff96e7724a
3 changed files with 7 additions and 2 deletions

View File

@@ -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)

View File

@@ -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'] = [];

View File

@@ -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);
}
/**