aboutsummaryrefslogtreecommitdiff
path: root/lib/lib_rss.php
diff options
context:
space:
mode:
authorGravatar eta-orionis <3466670+eta-orionis@users.noreply.github.com> 2024-01-10 08:23:45 +0100
committerGravatar GitHub <noreply@github.com> 2024-01-10 08:23:45 +0100
commit9c97d8ca729e3cfb067445c0d3c9ad8284132aeb (patch)
tree256588d7a65cc8658c808bc7852c816f6ccc1cd2 /lib/lib_rss.php
parent9a80dde238caf1338b803f67003cd459393efdc3 (diff)
JSONFeeds, JSON scraping, and POST requests for feeds (#5662)
* allow POST requests for feeds * added json dotpath and jsonfeed subscriptions. No translation strings yet * debug and fix jsonfeed parser * bugfix params saved when editing feed * added translations for JSON features * Update docs for web scraping * make fix-all and revert unrelated changes, plus a few manual fixes, but there are still several type errors * Fix some i18n * refactor json parsing for both feed types * cleanup unnecessary comment * refactored generation of SimplePie for XPath and JSON feeds * Fix merge error * Update to newer FreshRSS code * A bit of refactoring * doc, whitespace * JSON Feed is in two words * Add support for array syntax * Whitespace * Add OPML export/import * Work on i18n * Accept application/feed+json * Rework POST * Fix update * OPML for cURL options * Fix types * Fix Typos --------- Co-authored-by: Erion Elmasllari <elmasllari@factorsixty.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'lib/lib_rss.php')
-rw-r--r--lib/lib_rss.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index e01e8fa81..fa02c50eb 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -428,7 +428,7 @@ function httpGet(string $url, string $cachePath, string $type = 'html', array $a
$accept = '*/*;q=0.8';
switch ($type) {
case 'json':
- $accept = 'application/json,application/javascript;q=0.9,text/javascript;q=0.8,*/*;q=0.7';
+ $accept = 'application/json,application/feed+json,application/javascript;q=0.9,text/javascript;q=0.8,*/*;q=0.7';
break;
case 'opml':
$accept = 'text/x-opml,text/xml;q=0.9,application/xml;q=0.9,*/*;q=0.8';
@@ -481,7 +481,7 @@ function httpGet(string $url, string $cachePath, string $type = 'html', array $a
// TODO: Implement HTTP 410 Gone
} elseif (!is_string($body) || strlen($body) === 0) {
$body = '';
- } else {
+ } elseif ($type !== 'json') {
$body = enforceHttpEncoding($body, $c_content_type);
}