mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-02-16 23:29:56 +03:00
fix: use accept header when fetching feed (#2737)
* fix: use accept header when fetching feed * fix: include atom too, and reuse constants from format classes * add a catch all accept header
This commit is contained in:
parent
4007afdcf5
commit
1d0a0b927b
1 changed files with 8 additions and 1 deletions
|
@ -91,7 +91,14 @@ abstract class FeedExpander extends BridgeAbstract {
|
|||
/* Notice we do not use cache here on purpose:
|
||||
* we want a fresh view of the RSS stream each time
|
||||
*/
|
||||
$content = getContents($url)
|
||||
|
||||
$mimeTypes = [
|
||||
MrssFormat::MIME_TYPE,
|
||||
AtomFormat::MIME_TYPE,
|
||||
'*/*',
|
||||
];
|
||||
$httpHeaders = ['Accept: ' . implode(', ', $mimeTypes)];
|
||||
$content = getContents($url, $httpHeaders)
|
||||
or returnServerError('Could not request ' . $url);
|
||||
$rssContent = simplexml_load_string(trim($content));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue