@nuxt/webpack-builder-nightly 4.4.6-29641832.dfbe0423 → 4.4.6-29642119.4bdd9dd4
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/dist/index.mjs +15 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1392,7 +1392,7 @@ async function createDevMiddleware(compiler) {
|
|
|
1392
1392
|
function wdmToH3Handler(devMiddleware) {
|
|
1393
1393
|
return defineEventHandler(async (event) => {
|
|
1394
1394
|
const { req, res } = "runtime" in event ? event.runtime.node : event.node;
|
|
1395
|
-
if (req
|
|
1395
|
+
if (!isSameOriginRequest(req)) {
|
|
1396
1396
|
res.statusCode = 403;
|
|
1397
1397
|
res.end("Forbidden");
|
|
1398
1398
|
return;
|
|
@@ -1414,6 +1414,20 @@ function wdmToH3Handler(devMiddleware) {
|
|
|
1414
1414
|
});
|
|
1415
1415
|
});
|
|
1416
1416
|
}
|
|
1417
|
+
function isSameOriginRequest(req) {
|
|
1418
|
+
const site = firstHeader(req.headers["sec-fetch-site"]);
|
|
1419
|
+
if (site !== void 0) return site === "same-origin" || site === "none";
|
|
1420
|
+
const initiator = firstHeader(req.headers.origin) || firstHeader(req.headers.referer);
|
|
1421
|
+
if (!initiator) return true;
|
|
1422
|
+
try {
|
|
1423
|
+
return new URL(initiator).host === firstHeader(req.headers.host);
|
|
1424
|
+
} catch {
|
|
1425
|
+
return false;
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
function firstHeader(value) {
|
|
1429
|
+
return Array.isArray(value) ? value[0] : value;
|
|
1430
|
+
}
|
|
1417
1431
|
async function compile(compiler) {
|
|
1418
1432
|
const nuxt = useNuxt();
|
|
1419
1433
|
await nuxt.callHook(`${builder}:compile`, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/webpack-builder-nightly",
|
|
3
|
-
"version": "4.4.6-
|
|
3
|
+
"version": "4.4.6-29642119.4bdd9dd4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@nuxt/friendly-errors-webpack-plugin": "^2.6.0",
|
|
28
|
-
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.4.6-
|
|
28
|
+
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.4.6-29642119.4bdd9dd4",
|
|
29
29
|
"@vue/compiler-sfc": "3.5.34",
|
|
30
30
|
"autoprefixer": "^10.5.0",
|
|
31
31
|
"css-loader": "^7.1.4",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"webpackbar": "^7.0.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.4.6-
|
|
71
|
+
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.4.6-29642119.4bdd9dd4",
|
|
72
72
|
"@rspack/core": "1.7.11",
|
|
73
73
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
74
74
|
"@types/webpack-hot-middleware": "2.25.12",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"vue": "3.5.34"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
|
-
"nuxt": "npm:nuxt-nightly@4.4.6-
|
|
82
|
+
"nuxt": "npm:nuxt-nightly@4.4.6-29642119.4bdd9dd4",
|
|
83
83
|
"vue": "^3.3.4"
|
|
84
84
|
},
|
|
85
85
|
"engines": {
|