Download src/app/api/debug/session/route.ts from HonzaH/Letschat: direct link, hf CLI and curl.
- Browser
- Download file 643 Bytes
-
https://huggingface.co/spaces/HonzaH/Letschat/resolve/main/src/app/api/debug/session/route.ts
- Command line
-
hf download hf://spaces/HonzaH/Letschat/src/app/api/debug/session/route.ts
-
curl -L -o route.ts https://huggingface.co/spaces/HonzaH/Letschat/resolve/main/src/app/api/debug/session/route.ts
643 Bytes
| import { NextRequest, NextResponse } from 'next/server' | |
| import { getAppSession } from 'lib/appSession' | |
| export async function GET(request: NextRequest) { | |
| try { | |
| const session = await getAppSession() | |
| // Echo some headers and cookies for debugging | |
| const headers: Record<string, string | null> = { | |
| host: request.headers.get('host'), | |
| referer: request.headers.get('referer'), | |
| 'user-agent': request.headers.get('user-agent'), | |
| cookie: request.headers.get('cookie') | |
| } | |
| return NextResponse.json({ session, headers }) | |
| } catch (e) { | |
| return NextResponse.json({ error: String(e) }, { status: 500 }) | |
| } | |
| } | |