Clear stale active session ids

This commit is contained in:
武阳
2026-05-07 15:52:12 +08:00
parent 7a8152fba8
commit b0ae8ad0be
2 changed files with 13 additions and 5 deletions
@@ -14,7 +14,11 @@ export async function GET(req: Request) {
if (sessionId) url.searchParams.set("session_id", sessionId);
try {
const response = await fetch(url, { cache: "no-store" });
let response = await fetch(url, { cache: "no-store" });
if (response.status === 404 && sessionId) {
url.searchParams.delete("session_id");
response = await fetch(url, { cache: "no-store" });
}
const payload = await response.text();
return new Response(payload, {
status: response.status,