feat(F-099): completed feature
This commit is contained in:
@@ -17,6 +17,16 @@ export async function GET(req: NextRequest) {
|
||||
const backendRes = await fetch(`${API}/${path}`, {
|
||||
headers: { Cookie: cookies },
|
||||
});
|
||||
if (path === 'admin/logs/stream') {
|
||||
return new Response(backendRes.body, {
|
||||
status: backendRes.status,
|
||||
headers: {
|
||||
'Content-Type': backendRes.headers.get('content-type') ?? 'text/event-stream',
|
||||
'Cache-Control': backendRes.headers.get('cache-control') ?? 'no-cache',
|
||||
Connection: 'keep-alive',
|
||||
},
|
||||
});
|
||||
}
|
||||
const data = await backendRes.json().catch(() => null);
|
||||
const resp = NextResponse.json(data ?? { error: 'Bad response' }, { status: backendRes.status });
|
||||
return resp;
|
||||
|
||||
Reference in New Issue
Block a user