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 --- app/Controllers/feedController.php | 3 ++- app/Controllers/subscriptionController.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'app/Controllers') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 3ceb00f4a..e64607277 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -211,8 +211,9 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController { } } } + + $headers = array_filter(array_map('trim', $headers)); if (!empty($headers)) { - $headers = array_filter(array_map('trim', $headers)); $opts[CURLOPT_HTTPHEADER] = array_merge($headers, $opts[CURLOPT_HTTPHEADER] ?? []); } diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index 800f6b7c9..08103bcbf 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -194,8 +194,8 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController { } } + $headers = array_filter(array_map('trim', $headers)); if (!empty($headers)) { - $headers = array_filter(array_map('trim', $headers)); $opts[CURLOPT_HTTPHEADER] = array_merge($headers, $opts[CURLOPT_HTTPHEADER] ?? []); } -- cgit v1.2.3