From 152e96d3d06b626574ecc79781479d46c7d9867d Mon Sep 17 00:00:00 2001 From: Dag Date: Mon, 30 Dec 2024 00:19:18 +0100 Subject: fix: broken if_not_modified_since (#4377) --- lib/contents.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'lib/contents.php') diff --git a/lib/contents.php b/lib/contents.php index 56a3db20..752c0ff2 100644 --- a/lib/contents.php +++ b/lib/contents.php @@ -24,6 +24,13 @@ function getContents( // TODO: consider url validation at this point + $config = [ + 'useragent' => Configuration::getConfig('http', 'useragent'), + 'timeout' => Configuration::getConfig('http', 'timeout'), + 'retries' => Configuration::getConfig('http', 'retries'), + 'curl_options' => $curlOptions, + ]; + $httpHeadersNormalized = []; foreach ($httpHeaders as $httpHeader) { $parts = explode(':', $httpHeader); @@ -69,13 +76,7 @@ function getContents( 'TE' => 'trailers', ]; - $config = [ - 'useragent' => Configuration::getConfig('http', 'useragent'), - 'timeout' => Configuration::getConfig('http', 'timeout'), - 'retries' => Configuration::getConfig('http', 'retries'), - 'headers' => array_merge($defaultHttpHeaders, $httpHeadersNormalized), - 'curl_options' => $curlOptions, - ]; + $config['headers'] = array_merge($defaultHttpHeaders, $httpHeadersNormalized); $maxFileSize = Configuration::getConfig('http', 'max_filesize'); if ($maxFileSize) { -- cgit v1.2.3 From 824ac5e373563ac481a96c2b9d40999747654a48 Mon Sep 17 00:00:00 2001 From: Dag Date: Sun, 26 Jan 2025 21:24:33 +0100 Subject: docs (#4427) * docs * docs --- .github/ISSUE_TEMPLATE/bridge-request.md | 4 ++-- README.md | 5 ++--- config.default.ini.php | 2 +- lib/contents.php | 4 +--- templates/frontpage.html.php | 2 +- 5 files changed, 7 insertions(+), 10 deletions(-) (limited to 'lib/contents.php') diff --git a/.github/ISSUE_TEMPLATE/bridge-request.md b/.github/ISSUE_TEMPLATE/bridge-request.md index 174dc095..088cc3d6 100644 --- a/.github/ISSUE_TEMPLATE/bridge-request.md +++ b/.github/ISSUE_TEMPLATE/bridge-request.md @@ -49,9 +49,9 @@ Please describe what you expect from the bridge. Whenever possible provide sampl - _Default limit_: 5 - [ ] Load full articles - _Cache articles_ (articles are stored in a local cache on first request): yes - - _Cache timeout_ (max = 24 hours): 24 hours + - _Cache timeout_ : 24 hours - [X] Balance requests (RSS-Bridge uses cached versions to reduce bandwith usage) - - _Timeout_ (default = 5 minutes, max = 24 hours): 5 minutes + - _Timeout_ (default = 5 minutes): 5 minutes diff --git a/README.md b/README.md index b813abf7..dadf7094 100644 --- a/README.md +++ b/README.md @@ -150,11 +150,11 @@ listen = /run/php/rss-bridge.sock listen.owner = www-data listen.group = www-data -# Create 10 workers standing by to serve requests +; Create 10 workers standing by to serve requests pm = static pm.max_children = 10 -# Respawn worker after 500 requests (workaround for memory leaks etc.) +; Respawn worker after 500 requests (workaround for memory leaks etc.) pm.max_requests = 500 ``` @@ -460,7 +460,6 @@ See [CONTRIBUTORS.md](CONTRIBUTORS.md) RSS-Bridge uses caching to prevent services from banning your server for repeatedly updating feeds. The specific cache duration can be different between bridges. -Cached files are deleted automatically after 24 hours. RSS-Bridge allows you to take full control over which bridges are displayed to the user. That way you can host your own RSS-Bridge service with your favorite collection of bridges! diff --git a/config.default.ini.php b/config.default.ini.php index 886878a2..6d646fd5 100644 --- a/config.default.ini.php +++ b/config.default.ini.php @@ -75,7 +75,7 @@ custom_timeout = false ; "" = Disabled (default) email = "" -; Advertise a contact Telegram url e.g. "https://t.me/elegantobjects" +; Advertise a contact URL (can be any URL!) e.g. "https://t.me/elegantobjects" telegram = "" ; Show Donation information for bridges if available. diff --git a/lib/contents.php b/lib/contents.php index 752c0ff2..b4d70817 100644 --- a/lib/contents.php +++ b/lib/contents.php @@ -177,11 +177,9 @@ function getSimpleHTMLDOM( } /** - * Gets contents from the Internet as simplhtmldom object. Contents are cached + * Fetch contents from the Internet as simplhtmldom object. Contents are cached * and re-used for subsequent calls until the cache duration elapsed. * - * _Notice_: Cached contents are forcefully removed after 24 hours (86400 seconds). - * * @param string $url The URL. * @param int $ttl Cache duration in seconds. * @param array $header (optional) A list of cURL header. diff --git a/templates/frontpage.html.php b/templates/frontpage.html.php index c1182673..f285e8d6 100644 --- a/templates/frontpage.html.php +++ b/templates/frontpage.html.php @@ -52,7 +52,7 @@
- Telegram: + Url:
-- cgit v1.2.3