@akinon/next 1.47.0-rc.4 → 1.47.0-rc.5
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 +6 -0
- package/api/client.ts +11 -8
- package/package.json +2 -2
- package/types/index.ts +1 -0
- package/utils/app-fetch.ts +1 -0
- package/utils/server-variables.ts +2 -1
package/CHANGELOG.md
CHANGED
package/api/client.ts
CHANGED
|
@@ -52,18 +52,24 @@ async function proxyRequest(...args) {
|
|
|
52
52
|
extraHeaders[key.toLowerCase()] = value;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
[
|
|
55
|
+
const excludedHeaders = [
|
|
56
56
|
'x-forwarded-host',
|
|
57
57
|
'x-forwarded-proto',
|
|
58
58
|
'x-forwarded-port',
|
|
59
59
|
'x-requested-with',
|
|
60
60
|
'origin',
|
|
61
|
-
'host',
|
|
62
61
|
'referer',
|
|
63
62
|
'accept',
|
|
64
63
|
'content-length',
|
|
65
|
-
'content-type'
|
|
66
|
-
|
|
64
|
+
'content-type',
|
|
65
|
+
'host'
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
excludedHeaders.forEach((header) => {
|
|
69
|
+
if (!settings.includedProxyHeaders?.includes(header)) {
|
|
70
|
+
delete extraHeaders[header];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
67
73
|
|
|
68
74
|
const fetchOptions = {
|
|
69
75
|
method: req.method,
|
|
@@ -146,11 +152,8 @@ async function proxyRequest(...args) {
|
|
|
146
152
|
try {
|
|
147
153
|
const request = await fetch(url, fetchOptions);
|
|
148
154
|
|
|
149
|
-
// Using NextResponse.json with status 204 will cause an error
|
|
150
155
|
if (request.status === 204) {
|
|
151
|
-
return new Response(null, {
|
|
152
|
-
status: 204
|
|
153
|
-
});
|
|
156
|
+
return new Response(null, { status: 204 });
|
|
154
157
|
}
|
|
155
158
|
|
|
156
159
|
let response = {} as any;
|
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.47.0-rc.
|
|
4
|
+
"version": "1.47.0-rc.5",
|
|
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.47.0-rc.
|
|
33
|
+
"@akinon/eslint-plugin-projectzero": "1.47.0-rc.5",
|
|
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",
|
package/types/index.ts
CHANGED
package/utils/app-fetch.ts
CHANGED