in http_get_contents, detect and recover from curl error 23

change from null to "deflate"
This commit is contained in:
ljm42
2024-05-04 15:58:35 -07:00
parent f901cc9d4e
commit ae8feb2dbc

View File

@@ -181,8 +181,8 @@ function http_get_contents(string $url, array $opts = [], array &$getinfo = NULL
}
$out = curl_exec($ch);
if (curl_errno($ch) == 23) {
// error 23 detected, try CURLOPT_ENCODING = null
curl_setopt($ch, CURLOPT_ENCODING, null);
// error 23 detected, try CURLOPT_ENCODING = "deflate"
curl_setopt($ch, CURLOPT_ENCODING, "deflate");
$out = curl_exec($ch);
}
if (isset($getinfo)) {