Skip to content

Commit

Permalink
Disable compile validate instead of replacing unnamed patterns in des…
Browse files Browse the repository at this point in the history
…tination
  • Loading branch information
ijjk committed Jan 27, 2020
1 parent 9b34575 commit dadbfde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
1 change: 0 additions & 1 deletion packages/next/next-server/server/lib/path-match.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export default (customRoute = false) => {

return { ...params, ...res.params }
}
;(wrappedMatcher as any).keys = keys as any
return wrappedMatcher
}
}
Expand Down
13 changes: 3 additions & 10 deletions packages/next/next-server/server/next-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,16 +457,9 @@ export default class Server {
let destToCompile = `${parsedDestination.pathname!}${parsedDestination.hash ||
''}`

for (const key of (route.matcher as any).keys || []) {
const { name, pattern } = key
if (typeof name === 'number') {
destToCompile = destToCompile.replace(
new RegExp(`(\\:${name}(?![0-9]))`, 'g'),
`(${pattern})`
)
}
}
let destinationCompiler = compilePathToRegex(destToCompile)
let destinationCompiler = compilePathToRegex(destToCompile, {
validate: false,
})
let newUrl

Object.keys(destQuery).forEach(key => {
Expand Down

0 comments on commit dadbfde

Please sign in to comment.