mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00: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
@ -91,7 +91,14 @@ abstract class FeedExpander extends BridgeAbstract {
|
|||||||
/* Notice we do not use cache here on purpose:
|
/* Notice we do not use cache here on purpose:
|
||||||
* we want a fresh view of the RSS stream each time
|
* 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);
|
or returnServerError('Could not request ' . $url);
|
||||||
$rssContent = simplexml_load_string(trim($content));
|
$rssContent = simplexml_load_string(trim($content));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user