@akinon/next 1.60.0-rc.10 → 1.60.0-rc.12
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 +12 -0
- package/middlewares/url-redirection.ts +14 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @akinon/next
|
|
2
2
|
|
|
3
|
+
## 1.60.0-rc.12
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 033b084: ZERO-2956: refactor redirect response handling for set-cookie headers
|
|
8
|
+
|
|
9
|
+
## 1.60.0-rc.11
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- fcea495: ZERO-2956: add set-cookies headers in url-redirection middleware
|
|
14
|
+
|
|
3
15
|
## 1.60.0-rc.10
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NextFetchEvent, NextMiddleware } from 'next/server';
|
|
1
|
+
import { NextFetchEvent, NextMiddleware, NextResponse } from 'next/server';
|
|
2
2
|
import settings from 'settings';
|
|
3
3
|
import { PzNextRequest } from '.';
|
|
4
4
|
import logger from '../utils/log';
|
|
@@ -58,7 +58,19 @@ const withUrlRedirection =
|
|
|
58
58
|
req.middlewareParams.rewrites.locale
|
|
59
59
|
);
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
const setCookies = request.headers.getSetCookie();
|
|
62
|
+
|
|
63
|
+
const response = NextResponse.redirect(redirectUrl.toString(), {
|
|
64
|
+
status: request.status
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
if (setCookies && setCookies.length > 0) {
|
|
68
|
+
for (const cookie of setCookies) {
|
|
69
|
+
response.headers.append('Set-Cookie', cookie);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return response;
|
|
62
74
|
}
|
|
63
75
|
} catch (error) {
|
|
64
76
|
logger.error('withUrlRedirection error', {
|
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.60.0-rc.
|
|
4
|
+
"version": "1.60.0-rc.12",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"set-cookie-parser": "2.6.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@akinon/eslint-plugin-projectzero": "1.60.0-rc.
|
|
33
|
+
"@akinon/eslint-plugin-projectzero": "1.60.0-rc.12",
|
|
34
34
|
"@types/react-redux": "7.1.30",
|
|
35
35
|
"@types/set-cookie-parser": "2.4.7",
|
|
36
36
|
"@typescript-eslint/eslint-plugin": "6.7.4",
|