Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions packages/next/src/lib/build-custom-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ export function buildCustomRoute(
delimiter: '/', // default is `/#?`, but Next does not pass query info
})

let source = compiled.source
if (!route.internal) {
source = modifyRouteRegex(
source,
type === 'redirect' ? restrictedRedirectPaths : undefined
)
}

// If this is an internal rewrite and it already provides a regex, use it
// otherwise, normalize the source to a regex.
let regex: string
Expand All @@ -54,6 +46,14 @@ export function buildCustomRoute(
!('regex' in route) ||
typeof route.regex !== 'string'
) {
let source = compiled.source
if (!route.internal) {
source = modifyRouteRegex(
source,
type === 'redirect' ? restrictedRedirectPaths : undefined
)
}

regex = normalizeRouteRegex(source)
} else {
regex = route.regex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export function generateInterceptionRoutesRewrites(
value: headerRegex,
},
],
internal: true,
regex: source.namedRegex,
})
}
Expand Down
21 changes: 0 additions & 21 deletions test/e2e/app-dir/parallel-routes-and-interception/next.config.js

This file was deleted.

Loading
Loading