Fix HTTP GET curl options (#6492)

fix https://github.com/FreshRSS/FreshRSS/issues/6491
Regression from https://github.com/FreshRSS/FreshRSS/pull/6177
This commit is contained in:
Alexandre Alapetite
2024-05-25 18:27:12 +02:00
committed by GitHub
parent 3e7054bddd
commit 3cd90a2b1f
4 changed files with 4 additions and 1 deletions

View File

@@ -719,7 +719,7 @@ HTML;
}
$cachePath = $feed->cacheFilename($url . '#' . $feed->pathEntries());
$html = httpGet($url, $cachePath, 'html');
$html = httpGet($url, $cachePath, 'html', $feed->attributes(), $feed->curlOptions());
if (strlen($html) > 0) {
$doc = new DOMDocument();
$doc->loadHTML($html, LIBXML_NONET | LIBXML_NOERROR | LIBXML_NOWARNING);

View File

@@ -1058,6 +1058,7 @@ class FreshRSS_Feed extends Minz_Model {
CURLOPT_MAXREDIRS => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_ENCODING => '', //Enable all encodings
//CURLOPT_VERBOSE => 1, // To debug sent HTTP headers
]);
$response = curl_exec($ch);
$info = curl_getinfo($ch);

View File

@@ -38,6 +38,7 @@ function downloadHttp(string &$url, array $curlOptions = []): string {
CURLOPT_MAXREDIRS => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_ENCODING => '', //Enable all encodings
//CURLOPT_VERBOSE => 1, // To debug sent HTTP headers
]);
FreshRSS_Context::initSystem();

View File

@@ -544,6 +544,7 @@ function httpGet(string $url, string $cachePath, string $type = 'html', array $a
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_ENCODING => '', //Enable all encodings
//CURLOPT_VERBOSE => 1, // To debug sent HTTP headers
]);
curl_setopt_array($ch, FreshRSS_Context::systemConf()->curl_options);