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:
Elie Habib
2026-02-28 14:52:45 +04:00
committed by GitHub
parent e55177a125
commit e2f6c46e45
3 changed files with 16 additions and 10 deletions

View File

@@ -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\./, '');