aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Pavel Korytov <thexcloud@gmail.com> 2024-07-31 22:57:20 +0300
committerGravatar GitHub <noreply@github.com> 2024-07-31 21:57:20 +0200
commitb505667168225a74c30e7b58ab6a54bc00c3b89e (patch)
treebe42a07e70159ca090056170ccfd4692e3f63c71 /lib
parent615c5335878be434a9051278126f7286e1549e14 (diff)
downloadrss-bridge-b505667168225a74c30e7b58ab6a54bc00c3b89e.tar.gz
rss-bridge-b505667168225a74c30e7b58ab6a54bc00c3b89e.tar.zst
rss-bridge-b505667168225a74c30e7b58ab6a54bc00c3b89e.zip
[SubstackBridge] Add Substack bridge (#4174)
* [SubstackBridge] Add Substack * [SubstackBridge] Add docs * [SubstackBridge] Fix lint * [SubstackBridge] Update description * [SubstackBridge] Update description (x2)
Diffstat (limited to 'lib')
-rw-r--r--lib/FeedExpander.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/FeedExpander.php b/lib/FeedExpander.php
index fe809bc2..ef001af1 100644
--- a/lib/FeedExpander.php
+++ b/lib/FeedExpander.php
@@ -7,7 +7,7 @@ abstract class FeedExpander extends BridgeAbstract
{
private array $feed;
- public function collectExpandableDatas(string $url, $maxItems = -1)
+ public function collectExpandableDatas(string $url, $maxItems = -1, $headers = [])
{
if (!$url) {
throw new \Exception('There is no $url for this RSS expander');
@@ -17,7 +17,7 @@ abstract class FeedExpander extends BridgeAbstract
$maxItems = 999;
}
$accept = [MrssFormat::MIME_TYPE, AtomFormat::MIME_TYPE, '*/*'];
- $httpHeaders = ['Accept: ' . implode(', ', $accept)];
+ $httpHeaders = array_merge(['Accept: ' . implode(', ', $accept)], $headers);
$xmlString = getContents($url, $httpHeaders);
if ($xmlString === '') {
throw new \Exception(sprintf('Unable to parse xml from `%s` because we got the empty string', $url), 10);