1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-08 17:46:34 +02:00

refactor: return proper response object (#4169)

This commit is contained in:
Dag
2024-07-31 17:30:06 +02:00
committed by GitHub
parent aa3989873c
commit 891c8979a3
28 changed files with 69 additions and 84 deletions

View File

@@ -191,15 +191,12 @@ HEREDOC;
}
}
/**
* Extract the cookies obtained from the URL
* @return array the array containing the cookies set by the URL
*/
private function getCookiesHeaderValue($url)
{
$response = getContents($url, [], [], true);
$setCookieHeaders = $response['headers']['set-cookie'] ?? [];
$setCookieHeaders = $response->getHeader('set-cookie', true);
$cookies = array_map(fn($c): string => explode(';', $c)[0], $setCookieHeaders);
return implode('; ', $cookies);
}