Fix router.refresh missing canonical url override (#65999)
Fixes https://github.com/vercel/next.js/issues/65970 ---- The browser update happens at https://github.com/vercel/next.js/blob/10d5c278bc0e9eab067df7b5f3943c12ab54a6a9/packages/next/src/client/components/app-router.tsx#L685, which sets the browser location to `canonicalUrl`. `canonicalUrl` was correctly set at https://github.com/vercel/next.js/blob/ab03c3261f53fcff1fb3387673cfd170a626564c/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.ts#L98, but then mistakenly overriden at https://github.com/vercel/next.js/blob/51549d92de3069b6dc5cd1f5fcdc04d5b1cbf37a/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.ts#L129. This PR fixes that and includes an E2E test to prevent future regression. --------- Co-authored-by:JJ Kasper <jj@jjsweb.site> Co-authored-by:
Zack Tanner <1939140+ztanner@users.noreply.github.com>
Showing
Please
register
or
sign in
to comment