Handle valid HTTP responses with no response body.

This commit is contained in:
wn_ 2022-08-14 16:38:58 +00:00
parent ed2cbeffcc
commit 57e31fe5a7
1 changed files with 10 additions and 1 deletions

View File

@ -462,7 +462,11 @@ class UrlHelper {
}
if (!$contents) {
if (curl_errno($ch) === 0) {
self::$fetch_last_error = 'Successful response, but no content was received.';
} else {
self::$fetch_last_error = curl_errno($ch) . " " . curl_error($ch);
}
curl_close($ch);
return false;
}
@ -578,6 +582,11 @@ class UrlHelper {
return false;
}
if (!$data) {
self::$fetch_last_error = 'Successful response, but no content was received.';
return false;
}
$is_gzipped = RSSUtils::is_gzipped($data);
if ($is_gzipped && $data) {