Fix duplicate HTTP header for POST (#7556)

Using POST with JSON would add `Content-Type: application/json` again and again everytime the feed's settings were saved
This commit is contained in:
Alexandre Alapetite
2025-05-05 18:55:43 +02:00
committed by GitHub
parent 2063e445af
commit b2f80ad00a
2 changed files with 2 additions and 0 deletions

View File

@@ -215,6 +215,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
$headers = array_filter(array_map('trim', $headers));
if (!empty($headers)) {
$opts[CURLOPT_HTTPHEADER] = array_merge($headers, $opts[CURLOPT_HTTPHEADER] ?? []);
$opts[CURLOPT_HTTPHEADER] = array_unique($opts[CURLOPT_HTTPHEADER]);
}
$attributes = [