diff options
| author | 2025-11-13 11:46:45 +0100 | |
|---|---|---|
| committer | 2025-11-13 11:46:45 +0100 | |
| commit | 947a8c015af1b93f6860fd0631299ddefe5bbd23 (patch) | |
| tree | 4bb2e70a936967f96bb64f85f5b121e2e0d77bef /app | |
| parent | e6f4fe048114143fb93c02bb105eedbba777f664 (diff) | |
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
Diffstat (limited to 'app')
| -rw-r--r-- | app/Utils/httpUtil.php | 5 |
1 files changed, 4 insertions, 1 deletions
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'; } /** |
