Skip to content

Commit

Permalink
Fix wrong asPath on 404 (vercel#15728)
Browse files Browse the repository at this point in the history
Caught this while reviewing router code for vercel#15710
  • Loading branch information
Janpot committed Jul 31, 2020
1 parent 01662f1 commit c9e379c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ if (
page === '/_error' &&
hydrateProps &&
hydrateProps.pageProps &&
hydrateProps.pageProps.statusCode === '404'
hydrateProps.pageProps.statusCode === 404
)
) {
asPath = delBasePath(asPath)
Expand Down
1 change: 1 addition & 0 deletions test/integration/basepath/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ const runTests = (context, dev = false) => {
it('should not update URL for a 404', async () => {
const browser = await webdriver(context.appPort, '/missing')
const pathname = await browser.eval(() => window.location.pathname)
expect(await browser.eval(() => window.next.router.asPath)).toBe('/missing')
expect(pathname).toBe('/missing')
})

Expand Down

0 comments on commit c9e379c

Please sign in to comment.