nitro-nightly 3.0.1-20251116-134446-b005d480 → 3.0.1-20251116-142138-25872617
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/_presets.mjs +12 -0
- package/dist/types/index.d.mts +7 -0
- package/package.json +1 -1
package/dist/_presets.mjs
CHANGED
|
@@ -1420,6 +1420,16 @@ function generateBuildConfig(nitro, o11Routes) {
|
|
|
1420
1420
|
if (routeRules.headers) route = defu(route, { headers: routeRules.headers });
|
|
1421
1421
|
return route;
|
|
1422
1422
|
}),
|
|
1423
|
+
...nitro.options.vercel?.skewProtection && nitro.options.manifest?.deploymentId ? [{
|
|
1424
|
+
src: "/.*",
|
|
1425
|
+
has: [{
|
|
1426
|
+
type: "header",
|
|
1427
|
+
key: "Sec-Fetch-Dest",
|
|
1428
|
+
value: "document"
|
|
1429
|
+
}],
|
|
1430
|
+
headers: { "Set-Cookie": `__vdpl=${nitro.options.manifest.deploymentId}; Path=${nitro.options.baseURL}; SameSite=Strict; Secure; HttpOnly` },
|
|
1431
|
+
continue: true
|
|
1432
|
+
}] : [],
|
|
1423
1433
|
...nitro.options.publicAssets.filter((asset) => !asset.fallthrough).map((asset) => joinURL(nitro.options.baseURL, asset.baseURL || "/")).map((baseURL) => ({
|
|
1424
1434
|
src: baseURL + "(.*)",
|
|
1425
1435
|
headers: { "cache-control": "public,max-age=31536000,immutable" },
|
|
@@ -1548,6 +1558,7 @@ async function writePrerenderConfig(filename, isrConfig, bypassToken) {
|
|
|
1548
1558
|
const vercel = defineNitroPreset({
|
|
1549
1559
|
entry: "./vercel/runtime/vercel.{format}",
|
|
1550
1560
|
manifest: { deploymentId: process.env.VERCEL_DEPLOYMENT_ID },
|
|
1561
|
+
vercel: { skewProtection: !!process.env.VERCEL_SKEW_PROTECTION_ENABLED },
|
|
1551
1562
|
output: {
|
|
1552
1563
|
dir: "{{ rootDir }}/.vercel/output",
|
|
1553
1564
|
serverDir: "{{ output.dir }}/functions/__server.func",
|
|
@@ -1582,6 +1593,7 @@ const vercel = defineNitroPreset({
|
|
|
1582
1593
|
const vercelStatic = defineNitroPreset({
|
|
1583
1594
|
extends: "static",
|
|
1584
1595
|
manifest: { deploymentId: process.env.VERCEL_DEPLOYMENT_ID },
|
|
1596
|
+
vercel: { skewProtection: !!process.env.VERCEL_SKEW_PROTECTION_ENABLED },
|
|
1585
1597
|
output: {
|
|
1586
1598
|
dir: "{{ rootDir }}/.vercel/output",
|
|
1587
1599
|
publicDir: "{{ output.dir }}/static/{{ baseURL }}"
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1780,6 +1780,13 @@ interface VercelServerlessFunctionConfig {
|
|
|
1780
1780
|
}
|
|
1781
1781
|
interface VercelOptions {
|
|
1782
1782
|
config: VercelBuildConfigV3;
|
|
1783
|
+
/**
|
|
1784
|
+
* If you have enabled skew protection in the Vercel dashboard, it will
|
|
1785
|
+
* be enabled by default.
|
|
1786
|
+
*
|
|
1787
|
+
* You can disable the Nitro integration by setting this option to `false`.
|
|
1788
|
+
*/
|
|
1789
|
+
skewProtection?: boolean;
|
|
1783
1790
|
/**
|
|
1784
1791
|
* If you are using `vercel-edge`, you can specify the region(s) for your edge function.
|
|
1785
1792
|
* @see https://vercel.com/docs/concepts/functions/edge-functions#edge-function-regions
|
package/package.json
CHANGED