@akinon/next 1.92.0-rc.34 → 1.92.0-rc.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/middlewares/default.ts +18 -13
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/middlewares/default.ts
CHANGED
|
@@ -302,19 +302,6 @@ const withPzDefault =
|
|
|
302
302
|
)}`;
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
if (
|
|
306
|
-
!req.middlewareParams.found &&
|
|
307
|
-
Settings.customNotFoundEnabled
|
|
308
|
-
) {
|
|
309
|
-
const pathname = url.pathname
|
|
310
|
-
.replace(/\/+$/, '')
|
|
311
|
-
.split('/');
|
|
312
|
-
url.pathname = url.pathname.replace(
|
|
313
|
-
pathname.pop(),
|
|
314
|
-
'pz-not-found'
|
|
315
|
-
);
|
|
316
|
-
}
|
|
317
|
-
|
|
318
305
|
Settings.rewrites.forEach((rewrite) => {
|
|
319
306
|
url.pathname = url.pathname.replace(
|
|
320
307
|
rewrite.source,
|
|
@@ -352,6 +339,24 @@ const withPzDefault =
|
|
|
352
339
|
middlewareResult = NextResponse.rewrite(url);
|
|
353
340
|
}
|
|
354
341
|
|
|
342
|
+
if (
|
|
343
|
+
!req.middlewareParams.found &&
|
|
344
|
+
Settings.customNotFoundEnabled
|
|
345
|
+
) {
|
|
346
|
+
const pathSegments = url.pathname
|
|
347
|
+
.replace(/\/+$/, '')
|
|
348
|
+
.split('/');
|
|
349
|
+
if (pathSegments.length >= 3) {
|
|
350
|
+
url.pathname = `/${pathSegments[1]}/${pathSegments[2]}/pz-not-found`;
|
|
351
|
+
} else {
|
|
352
|
+
url.pathname = '/pz-not-found';
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
middlewareResult = NextResponse.rewrite(url, {
|
|
356
|
+
status: 404
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
|
|
355
360
|
const { localeUrlStrategy } =
|
|
356
361
|
Settings.localization;
|
|
357
362
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/next",
|
|
3
3
|
"description": "Core package for Project Zero Next",
|
|
4
|
-
"version": "1.92.0-rc.
|
|
4
|
+
"version": "1.92.0-rc.36",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"set-cookie-parser": "2.6.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@akinon/eslint-plugin-projectzero": "1.92.0-rc.
|
|
37
|
+
"@akinon/eslint-plugin-projectzero": "1.92.0-rc.36",
|
|
38
38
|
"@babel/core": "7.26.10",
|
|
39
39
|
"@babel/preset-env": "7.26.9",
|
|
40
40
|
"@babel/preset-typescript": "7.27.0",
|