mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-25 17:14:57 +02:00
fix(relay): block rsshub.app requests with 410 Gone (#526)
Stale clients still send RSS requests to rsshub.app (NHK, MOFCOM, MIIT). These feeds were migrated to Google News RSS but cached PWA clients keep hitting the relay, which forwards to rsshub.app and gets 403. - Add explicit blocklist returning 410 Gone before allowlist check - Remove rsshub.app from all allowlists (relay, edge proxy, vite) - Remove dead AP News dev proxy target
This commit is contained in:
@@ -86,7 +86,6 @@ const ALLOWED_DOMAINS = [
|
||||
'openai.com',
|
||||
'www.reutersagency.com',
|
||||
'feeds.reuters.com',
|
||||
'rsshub.app',
|
||||
'asia.nikkei.com',
|
||||
'www.cfr.org',
|
||||
'www.csis.org',
|
||||
@@ -346,6 +345,15 @@ export default async function handler(req) {
|
||||
try {
|
||||
const parsedUrl = new URL(feedUrl);
|
||||
|
||||
// Block deprecated feed domains (stale clients still request these)
|
||||
const BLOCKED_DOMAINS = ['rsshub.app'];
|
||||
if (BLOCKED_DOMAINS.includes(parsedUrl.hostname)) {
|
||||
return new Response(JSON.stringify({ error: 'Feed deprecated' }), {
|
||||
status: 410,
|
||||
headers: { 'Content-Type': 'application/json', ...corsHeaders },
|
||||
});
|
||||
}
|
||||
|
||||
// Security: Check if domain is allowed (normalize www prefix)
|
||||
const hostname = parsedUrl.hostname;
|
||||
const bare = hostname.replace(/^www\./, '');
|
||||
|
||||
Reference in New Issue
Block a user