feat: add a timeout option for http client (#2600)

This commit is contained in:
dag 2022-04-08 21:22:13 +02:00 committed by GitHub
parent 8c18c02c65
commit cce11964a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 0 deletions

View file

@ -169,6 +169,7 @@ function getContents($url, $header = array(), $opts = array(), $returnHeader = f
}
curl_setopt($ch, CURLOPT_USERAGENT, Configuration::getConfig('http', 'useragent'));
curl_setopt($ch, CURLOPT_TIMEOUT, Configuration::getConfig('http', 'timeout'));
curl_setopt($ch, CURLOPT_ENCODING, '');
curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);