Skip to content

Commit

Permalink
Continue routing without basePath requirement check
Browse files Browse the repository at this point in the history
  • Loading branch information
inbeom committed Aug 19, 2020
1 parent ce12c48 commit 8b8b29f
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions packages/next/next-server/server/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ export default class Router {
// if it is set
let currentPathname = parsedUrlUpdated.pathname
const originalPathname = currentPathname
const requireBasePath = testRoute.requireBasePath !== false
const isCustomRoute = customRouteTypes.has(testRoute.type)

if (!isCustomRoute) {
Expand All @@ -176,14 +175,8 @@ export default class Router {

// Check if the match function matched
if (newParams) {
// since we require basePath be present for non-custom-routes we
// 404 here when we matched an fs route
if (!isCustomRoute) {
if (!originallyHadBasePath && !(req as any)._nextDidRewrite) {
if (requireBasePath) {
// consider this a non-match so the 404 renders
return false
}
// page checker occurs before rewrites so we need to continue
// to check those since they don't always require basePath
continue
Expand Down

0 comments on commit 8b8b29f

Please sign in to comment.