From ecdb63c33582963be055472a056c8e3e445fb5bf Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 5 Mar 2025 16:45:06 +0100 Subject: Fix regression cURL HTTP headers (#7403) * Fix regression cURL HTTP headers fix https://github.com/FreshRSS/FreshRSS/issues/6712#issuecomment-2697961491 We would sometimes wrongly override the default HTTP headers of SimplePie https://github.com/FreshRSS/simplepie/pull/33 https://github.com/simplepie/simplepie/pull/912 * Sync SimplePie https://github.com/FreshRSS/simplepie/pull/33 --- lib/simplepie/simplepie/src/File.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/simplepie') diff --git a/lib/simplepie/simplepie/src/File.php b/lib/simplepie/simplepie/src/File.php index 9099c8492..6f5f37c3c 100644 --- a/lib/simplepie/simplepie/src/File.php +++ b/lib/simplepie/simplepie/src/File.php @@ -115,6 +115,12 @@ class File implements Response foreach ($headers as $key => $value) { $headers2[] = "$key: $value"; } + if (isset($curl_options[CURLOPT_HTTPHEADER])) { + if (is_array($curl_options[CURLOPT_HTTPHEADER])) { + $headers2 = array_merge($headers2, $curl_options[CURLOPT_HTTPHEADER]); + } + unset($curl_options[CURLOPT_HTTPHEADER]); + } if (version_compare(\SimplePie\Misc::get_curl_version(), '7.10.5', '>=')) { curl_setopt($fp, CURLOPT_ENCODING, ''); } -- cgit v1.2.3