From 45bb86830e4030ae443c45168dd9f52408bf9de7 Mon Sep 17 00:00:00 2001 From: shinya Date: Thu, 14 Aug 2025 21:10:56 +0800 Subject: [PATCH] feat: fix /api/search/resources endpoints --- src/app/api/search/resources/route.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/app/api/search/resources/route.ts b/src/app/api/search/resources/route.ts index 01b5980..9a92aa4 100644 --- a/src/app/api/search/resources/route.ts +++ b/src/app/api/search/resources/route.ts @@ -1,23 +1,16 @@ -import { NextResponse } from 'next/server'; +import { NextRequest, NextResponse } from 'next/server'; import { getAvailableApiSites, getCacheTime } from '@/lib/config'; export const runtime = 'edge'; // OrionTV 兼容接口 -export async function GET() { +export async function GET(request: NextRequest) { + console.log('request', request.url); try { const apiSites = await getAvailableApiSites(); - const cacheTime = await getCacheTime(); - return NextResponse.json(apiSites, { - headers: { - 'Cache-Control': `public, max-age=${cacheTime}, s-maxage=${cacheTime}`, - 'CDN-Cache-Control': `public, s-maxage=${cacheTime}`, - 'Vercel-CDN-Cache-Control': `public, s-maxage=${cacheTime}`, - 'Netlify-Vary': 'query', - }, - }); + return NextResponse.json(apiSites); } catch (error) { return NextResponse.json({ error: '获取资源失败' }, { status: 500 }); }