Merge pull request #2307 from nextcloud/enh/noid/add-curl-timeout

add timeout for curl
This commit is contained in:
Simon L 2023-04-14 14:57:18 +02:00 committed by GitHub
commit 916a25a62e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -303,6 +303,8 @@ class ConfigurationManager
$testUrl = $protocol . $domain . ':443';
curl_setopt($ch, CURLOPT_URL, $testUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$response = (string)curl_exec($ch);
# Get rid of trailing \n
$response = str_replace("\n", "", $response);