@akinon/next 1.103.0-rc.80 → 1.103.0-rc.82
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 +0 -50
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/middlewares/default.ts
CHANGED
|
@@ -338,24 +338,6 @@ const withPzDefault =
|
|
|
338
338
|
middlewareResult = NextResponse.rewrite(url);
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
-
if (
|
|
342
|
-
!req.middlewareParams.found &&
|
|
343
|
-
Settings.customNotFoundEnabled
|
|
344
|
-
) {
|
|
345
|
-
const pathSegments = url.pathname
|
|
346
|
-
.replace(/\/+$/, '')
|
|
347
|
-
.split('/');
|
|
348
|
-
if (pathSegments.length >= 3) {
|
|
349
|
-
url.pathname = `/${pathSegments[1]}/${pathSegments[2]}/pz-not-found`;
|
|
350
|
-
} else {
|
|
351
|
-
url.pathname = '/pz-not-found';
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
middlewareResult = NextResponse.rewrite(url, {
|
|
355
|
-
status: 404
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
|
|
359
341
|
const { localeUrlStrategy } =
|
|
360
342
|
Settings.localization;
|
|
361
343
|
|
|
@@ -405,38 +387,6 @@ const withPzDefault =
|
|
|
405
387
|
}
|
|
406
388
|
);
|
|
407
389
|
|
|
408
|
-
if (
|
|
409
|
-
!url.pathname.startsWith(
|
|
410
|
-
`/${currency}/orders`
|
|
411
|
-
)
|
|
412
|
-
) {
|
|
413
|
-
const currentCookieLocale =
|
|
414
|
-
req.cookies.get('pz-locale')?.value;
|
|
415
|
-
|
|
416
|
-
const urlHasExplicitLocale =
|
|
417
|
-
url.pathname.match(urlLocaleMatcherRegex);
|
|
418
|
-
const shouldUpdateCookie =
|
|
419
|
-
!currentCookieLocale ||
|
|
420
|
-
urlHasExplicitLocale;
|
|
421
|
-
|
|
422
|
-
if (shouldUpdateCookie) {
|
|
423
|
-
middlewareResult.cookies.set(
|
|
424
|
-
'pz-locale',
|
|
425
|
-
locale?.length > 0
|
|
426
|
-
? locale
|
|
427
|
-
: defaultLocaleValue,
|
|
428
|
-
{
|
|
429
|
-
domain: rootHostname,
|
|
430
|
-
sameSite: 'none',
|
|
431
|
-
secure: true,
|
|
432
|
-
expires: new Date(
|
|
433
|
-
Date.now() + 1000 * 60 * 60 * 24 * 7
|
|
434
|
-
) // 7 days
|
|
435
|
-
}
|
|
436
|
-
);
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
|
|
440
390
|
if (
|
|
441
391
|
req.cookies.get('pz-locale') &&
|
|
442
392
|
req.cookies.get('pz-locale').value !== locale
|
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.103.0-rc.
|
|
4
|
+
"version": "1.103.0-rc.82",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"set-cookie-parser": "2.6.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@akinon/eslint-plugin-projectzero": "1.103.0-rc.
|
|
38
|
+
"@akinon/eslint-plugin-projectzero": "1.103.0-rc.82",
|
|
39
39
|
"@babel/core": "7.26.10",
|
|
40
40
|
"@babel/preset-env": "7.26.9",
|
|
41
41
|
"@babel/preset-typescript": "7.27.0",
|