0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00
router/e2e
Yuki Kakazu kekezun kkzn 426c2b54fe
fix: pass pathname to global request middleware in createStartHandler (#6648)
* fix: pass pathname to global request middleware in createStartHandler

The two `executeMiddleware` calls for global request middleware in
`createStartHandler` were missing the `pathname` property, causing it
to be `undefined` at runtime despite `RequestServerOptions` declaring
it as `pathname: string`.

- Add `pathname: url.pathname` to server function middleware execution
- Add `pathname: url.pathname` to page request middleware execution

The route-level middleware in `handleServerRoutes` already passes
`pathname` correctly.

Closes TanStack/router#6647

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test: add regression test for pathname in global request middleware (#6647)

Add e2e tests to server-functions-global-middleware verifying that
pathname is correctly passed to global request middleware in
createStartHandler.

- Add pathnameMiddleware that captures pathname from server callback
- Add dedicated pathname-middleware route and test page
- Verify pathname value on both SSR and client-side navigation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: remove unnecessary `as any` cast from pathname middleware test

The middleware type system correctly infers `requestMiddlewarePathname`
on the context, so the explicit cast is not needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* ci: apply automated fixes

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
History 2026-02-14 16:45:18 +01:00
..
e2e-utils fix: dev style with non runnable dev environments and basepath support (#6348) 2026-01-10 14:51:33 +01:00
react-router fix: shared virtual module for code-split routes (#6659) 2026-02-14 13:10:54 +01:00
react-start fix: pass pathname to global request middleware in createStartHandler (#6648) 2026-02-14 16:45:18 +01:00
solid-router chore: add source() to Tailwind v4 imports to ensure consistent hashing (#6459) 2026-01-24 01:49:12 +01:00
solid-start chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00
vue-router chore: add source() to Tailwind v4 imports to ensure consistent hashing (#6459) 2026-01-24 01:49:12 +01:00
vue-start chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00