From 947a8c015af1b93f6860fd0631299ddefe5bbd23 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 13 Nov 2025 11:46:45 +0100 Subject: Exclude local networks for domain-wide Retry-After (#8195) * Exclude local networks for domain-wide Retry-After Retry-After will be applied by URL and not by domain for local networks. fix https://github.com/FreshRSS/FreshRSS/issues/7880 * Improved logic for detection of local domains * Support ip6-localhost and a couple more variants * On more: .lan * Resolve IP address * Add .intranet --- app/Utils/httpUtil.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/Utils/httpUtil.php') diff --git a/app/Utils/httpUtil.php b/app/Utils/httpUtil.php index ffba3712a..df0d14ab5 100644 --- a/app/Utils/httpUtil.php +++ b/app/Utils/httpUtil.php @@ -10,11 +10,14 @@ final class FreshRSS_http_Util { if (!is_string($domain) || $domain === '') { return ''; } + $domainWide = Minz_Request::serverIsPublic($domain); $port = parse_url($url, PHP_URL_PORT); if (is_int($port)) { $domain .= ':' . $port; } - return self::RETRY_AFTER_PATH . urlencode($domain) . (empty($proxy) ? '' : ('_' . urlencode($proxy))) . '.txt'; + return self::RETRY_AFTER_PATH . urlencode($domain) . + ($domainWide ? '' : '_' . hash('sha256', $url)) . + (empty($proxy) ? '' : '_' . urlencode($proxy)) . '.txt'; } /** -- cgit v1.2.3