Files
James Anderson 97947ce775 fix(app-router): apply trailingSlash to route handler request URL (#1827) (#1835)
* fix(app-router): apply trailingSlash to route handler request URL (#1827)

App Router route handlers received a NextRequest whose `url` was
normalized with the default `trailingSlash: false` policy, so a request
to `/runtime/edge/` (with `trailingSlash: true`) surfaced `req.url`
without the trailing slash even though `req.nextUrl.pathname` kept it.

Thread the configured `trailingSlash` through the route-handler dispatch
chain (dispatch -> execution/cache -> tracked request -> NextRequest)
so `NextURL` applies the correct policy when computing `request.url`,
matching Next.js (test/e2e/app-dir/app-routes-trailing-slash).

Closes #1827

* test(app-router): cover node runtime for trailingSlash:false route handler (#1827)

Address ask-bonk review note on PR #1835: the trailingSlash:false suite
only exercised the edge runtime. Parameterize it over edge + node to
match the trailingSlash:true suite's coverage.
2026-06-08 19:02:38 +01:00
..