@tanstack/router-core 1.143.4 → 1.143.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/router.cjs +2 -6
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +2 -6
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +2 -24
package/package.json
CHANGED
package/src/router.ts
CHANGED
|
@@ -1188,33 +1188,11 @@ export class RouterCore<
|
|
|
1188
1188
|
|
|
1189
1189
|
const fullPath = url.href.replace(url.origin, '')
|
|
1190
1190
|
|
|
1191
|
-
// Save the internal pathname for route matching (before output rewrite)
|
|
1192
|
-
const internalPathname = url.pathname
|
|
1193
|
-
|
|
1194
|
-
// Compute publicHref by applying the output rewrite.
|
|
1195
|
-
//
|
|
1196
|
-
// The publicHref represents the URL as it should appear in the browser.
|
|
1197
|
-
// This must match what buildLocation computes for the same logical route,
|
|
1198
|
-
// otherwise the server-side redirect check will see a mismatch and trigger
|
|
1199
|
-
// an infinite redirect loop.
|
|
1200
|
-
//
|
|
1201
|
-
// We always apply the output rewrite (not conditionally) because the
|
|
1202
|
-
// incoming URL may have already been transformed by external middleware
|
|
1203
|
-
// before reaching the router. In that case, the input rewrite has nothing
|
|
1204
|
-
// to do, but we still need the output rewrite to reconstruct the correct
|
|
1205
|
-
// public-facing URL.
|
|
1206
|
-
//
|
|
1207
|
-
// Clone the URL to avoid mutating the one used for route matching.
|
|
1208
|
-
const urlForOutput = new URL(url.href)
|
|
1209
|
-
const rewrittenUrl = executeRewriteOutput(this.rewrite, urlForOutput)
|
|
1210
|
-
const publicHref =
|
|
1211
|
-
rewrittenUrl.pathname + rewrittenUrl.search + rewrittenUrl.hash
|
|
1212
|
-
|
|
1213
1191
|
return {
|
|
1214
1192
|
href: fullPath,
|
|
1215
|
-
publicHref,
|
|
1193
|
+
publicHref: href,
|
|
1216
1194
|
url: url,
|
|
1217
|
-
pathname: decodePath(
|
|
1195
|
+
pathname: decodePath(url.pathname),
|
|
1218
1196
|
searchStr,
|
|
1219
1197
|
search: replaceEqualDeep(previousLocation?.search, parsedSearch) as any,
|
|
1220
1198
|
hash: url.hash.split('#').reverse()[0] ?? '',
|