Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
785f4c23
Unverified
Commit
785f4c23
authored
Sep 30, 2026
by
Josh Story
Committed by
GitHub
Sep 30, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[lts-maintenance] Match Next data paths case-sensitively (#197)
parent
7217d63d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
match-next-data-pathname.test.ts
...ages/next/src/server/lib/match-next-data-pathname.test.ts
+17
-0
match-next-data-pathname.ts
packages/next/src/server/lib/match-next-data-pathname.ts
+1
-1
No files found.
packages/next/src/server/lib/match-next-data-pathname.test.ts
0 → 100644
View file @
785f4c23
import
{
matchNextDataPathname
}
from
'./match-next-data-pathname'
describe
(
'matchNextDataPathname'
,
()
=>
{
it
(
'matches the exact internal route'
,
()
=>
{
expect
(
matchNextDataPathname
(
'/_next/data/build-id/index.json'
)).
toEqual
({
path
:
[
'build-id'
,
'index.json'
],
})
})
it
.
each
([
'/_NEXT/data/build-id/index.json'
,
'/_next/DATA/build-id/index.json'
,
'/_NeXt/DaTa/build-id/index.json'
,
])(
'does not match a case variant: %s'
,
(
pathname
)
=>
{
expect
(
matchNextDataPathname
(
pathname
)).
toBe
(
false
)
})
})
packages/next/src/server/lib/match-next-data-pathname.ts
View file @
785f4c23
import
{
getPathMatch
}
from
'../../shared/lib/router/utils/path-match'
import
{
getPathMatch
}
from
'../../shared/lib/router/utils/path-match'
const
matcher
=
getPathMatch
(
'/_next/data/:path*'
)
const
matcher
=
getPathMatch
(
'/_next/data/:path*'
,
{
sensitive
:
true
}
)
export
function
matchNextDataPathname
(
pathname
:
string
|
null
|
undefined
)
{
export
function
matchNextDataPathname
(
pathname
:
string
|
null
|
undefined
)
{
if
(
typeof
pathname
!==
'string'
)
return
false
if
(
typeof
pathname
!==
'string'
)
return
false
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment