Skip to content

Commit fd9c8af

Browse files
authored
add more invalid paths for /_next/data (github#22423)
1 parent 9c12341 commit fd9c8af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

middleware/handle-invalid-paths.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default function handleInvalidPaths(req, res, next) {
4949
}
5050

5151
// Prevent various malicious injection attacks targeting Next.js
52-
if (req.path.match(/^\/_next[^/]/)) {
52+
if (req.path.match(/^\/_next[^/]/) || req.path === '/_next/data' || req.path === '/_next/data/') {
5353
return next(404)
5454
}
5555

0 commit comments

Comments
 (0)