Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/canary' into trailing-slash-ba…
Browse files Browse the repository at this point in the history
…sepath
  • Loading branch information
Janpot committed Jul 2, 2020
2 parents 30f575e + a0c6832 commit 657ea99
Show file tree
Hide file tree
Showing 9 changed files with 233 additions and 197 deletions.
14 changes: 13 additions & 1 deletion packages/next/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,19 @@ envConfig.setConfig({
publicRuntimeConfig: runtimeConfig || {},
})

const asPath = delBasePath(getURL())
let asPath = getURL()

// make sure not to attempt stripping basePath for 404s
if (
page !== '/404' &&
!(
page === '/_error' &&
hydrateProps &&
hydrateProps.pageProps.statusCode === '404'
)
) {
asPath = delBasePath(asPath)
}

const pageLoader = new PageLoader(buildId, prefix, page)
const register = ([r, f]) => pageLoader.registerPage(r, f)
Expand Down
Loading

0 comments on commit 657ea99

Please sign in to comment.