diff --git a/app/api/transport/route.ts b/app/api/transport/route.ts index daf708d..6d7797f 100644 --- a/app/api/transport/route.ts +++ b/app/api/transport/route.ts @@ -1,8 +1,12 @@ export const dynamic = 'force-dynamic' import { NextResponse } from 'next/server' +import { Agent } from 'undici' const ORGP_BASE = 'https://transport.orgp.spb.ru' +// ORGP TLS chain fails default verification in Node — match curl -k behaviour. +const insecureAgent = new Agent({ connect: { rejectUnauthorized: false } }) + export async function GET(req: Request) { const { searchParams } = new URL(req.url) const stopId = searchParams.get('stopId') @@ -31,8 +35,8 @@ export async function GET(req: Request) { }, body: body.toString(), cache: 'no-store', - // @ts-ignore next-internal option for timeout - next: { revalidate: 0 }, + // @ts-ignore — undici dispatcher option at runtime + dispatcher: insecureAgent, } )