Clear stale active session ids
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user