Next.js Discord

Discord Forum

fix: preserve basePath in Route Handler request URLs

Unanswered
Arab posted this in #help-forum
Open in Discord
Hey everyone — I have a small PR that passed bot review but needs one
human approval. It's been waiting since June 7.

PR: #94540 — fix: preserve basePath in Route Handler request URLs
Link: https://github.com/vercel/next.js/pull/94540

What it fixes: When basePath is configured, Route Handler request.url
had the basePath stripped out. This breaks any logic that reads the full URL.
The fix patches base-server.ts to pass basePath into RequestMeta so
NextRequestAdapter can reconstruct the full URL.

Tests pass (pnpm test-dev-turbo test/basePath-route-handler.test.ts).
Vercel bot approved the test placement. Just needs one human LGTM.

Can anyone who works on basePath/routing take a look? Thanks!

0 Replies