@thangnm.nip/arouter 0.1.12 → 0.1.13
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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +9 -8
- package/.next/standalone/.next/build-manifest.json +4 -4
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +4 -4
- package/.next/standalone/.next/routes-manifest.json +6 -0
- package/.next/standalone/.next/server/app/(dashboard)/mitm/page.js +2 -2
- package/.next/standalone/.next/server/app/(dashboard)/mitm/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/mitm/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/page.js +2 -2
- package/.next/standalone/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js +3 -3
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +2 -2
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js +2 -2
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/console-logs/route.js +2 -2
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/console-logs/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/logs/route.js +8 -0
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/logs/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/logs/route_client-reference-manifest.js +1 -0
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/settings/route.js +2 -2
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/.next/standalone/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/codex-settings/route.js +3 -3
- package/.next/standalone/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/copilot-settings/route.js +2 -2
- package/.next/standalone/.next/server/app/api/cli-tools/copilot-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/droid-settings/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/.next/standalone/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/opencode-settings/route.js +2 -2
- package/.next/standalone/.next/server/app/api/cli-tools/opencode-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/keys/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/keys/route.js +1 -1
- package/.next/standalone/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/locale/route.js +2 -2
- package/.next/standalone/.next/server/app/api/locale/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/models/alias/route.js +1 -1
- package/.next/standalone/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/models/route.js +1 -1
- package/.next/standalone/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/providers/route.js +1 -1
- package/.next/standalone/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/settings/route.js +1 -1
- package/.next/standalone/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/version/route.js +1 -1
- package/.next/standalone/.next/server/app/api/version/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/!KGRhc2hib2FyZCk/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/mitm.html +1 -1
- package/.next/standalone/.next/server/app/mitm.rsc +5 -5
- package/.next/standalone/.next/server/app/mitm.segments/!KGRhc2hib2FyZCk/mitm/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/mitm.segments/!KGRhc2hib2FyZCk/mitm.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/mitm.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/mitm.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/mitm.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/mitm.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +9 -8
- package/.next/standalone/.next/server/chunks/138.js +1 -1
- package/.next/standalone/.next/server/chunks/182.js +9 -2
- package/.next/standalone/.next/server/chunks/219.js +1 -0
- package/.next/standalone/.next/server/chunks/471.js +13 -0
- package/.next/standalone/.next/server/chunks/741.js +2 -2
- package/.next/standalone/.next/server/chunks/900.js +7 -0
- package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/.next/standalone/.next/server/middleware.js +2 -2
- package/.next/standalone/.next/server/next-font-manifest.js +1 -1
- package/.next/standalone/.next/server/next-font-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +2 -2
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/{702-726ccbcada41f8fa.js → 702-c4610efa55dfb155.js} +1 -1
- package/.next/standalone/.next/static/chunks/{794-e4409998c8ba5c29.js → 794-37dad9bbc14b04b8.js} +1 -1
- package/.next/standalone/.next/static/chunks/{852-6b2b2eefb2d99b28.js → 852-d8cad4b0d71288a2.js} +3 -3
- package/.next/standalone/.next/static/chunks/app/(dashboard)/layout-579c25ca675b41ac.js +1 -0
- package/.next/standalone/.next/static/chunks/app/(dashboard)/mitm/page-d25cf1803f6924ee.js +7 -0
- package/.next/standalone/.next/static/chunks/app/(dashboard)/{page-a4e7c4e324778903.js → page-5c09ac097fc0cc9b.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/_global-error/{page-a4e7c4e324778903.js → page-5c09ac097fc0cc9b.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/_not-found/{page-f6a07fd1289f84a5.js → page-038730efde50428c.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/{route-a4e7c4e324778903.js → route-5c09ac097fc0cc9b.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/antigravity-mitm/console-logs/{route-a4e7c4e324778903.js → route-5c09ac097fc0cc9b.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/antigravity-mitm/logs/route-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/antigravity-mitm/settings/route-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/claude-settings/route-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/codex-settings/route-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/copilot-settings/route-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/droid-settings/route-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/opencode-settings/route-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/keys/[id]/route-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/keys/route-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/locale/route-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/models/alias/route-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/models/route-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/providers/route-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/settings/route-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/version/route-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/{layout-6de9a5310276adf9.js → layout-6e491caa4df42293.js} +1 -1
- package/.next/standalone/.next/static/chunks/{main-9b410d84e10d7a77.js → main-842bf1ddb8ee9ec0.js} +2 -2
- package/.next/standalone/.next/static/chunks/{main-app-2ed2446a2e4f75e7.js → main-app-0fea626ed7ee1281.js} +1 -1
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-89d8af6ad4f69554.js +1 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-5c09ac097fc0cc9b.js +1 -0
- package/.next/standalone/.next/static/rZAYFVGk5tWg3Az1gc9jl/_buildManifest.js +1 -0
- package/.next/standalone/node_modules/@next/env/package.json +1 -1
- package/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
- package/.next/standalone/node_modules/next/dist/build/webpack-config.js +3 -3
- package/.next/standalone/node_modules/next/dist/compiled/http-proxy/index.js +5 -5
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-experimental.runtime.prod.js +3 -3
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +12 -12
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +3 -3
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js +3 -3
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js +2 -2
- package/.next/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +2 -2
- package/.next/standalone/node_modules/next/dist/compiled/next-server/pages.runtime.prod.js +2 -2
- package/.next/standalone/node_modules/next/dist/server/app-render/action-handler.js +7 -11
- package/.next/standalone/node_modules/next/dist/server/base-server.js +22 -8
- package/.next/standalone/node_modules/next/dist/server/config-schema.js +0 -1
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/image-optimizer.js +22 -148
- package/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/lru-cache.js +1 -2
- package/.next/standalone/node_modules/next/dist/server/lib/patch-fetch.js +6 -15
- package/.next/standalone/node_modules/next/dist/server/lib/router-server.js +3 -3
- package/.next/standalone/node_modules/next/dist/server/lib/router-utils/{block-cross-site-dev.js → block-cross-site.js} +17 -11
- package/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
- package/.next/standalone/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +1 -1
- package/.next/standalone/node_modules/next/dist/shared/lib/image-config.js +0 -1
- package/.next/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/events/version.js +2 -2
- package/.next/standalone/node_modules/next/package.json +16 -16
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/server.js +1 -1
- package/.next/standalone/src/mitm/manager.js +30 -9
- package/bin/arouter.js +292 -0
- package/bin/arouter.mjs +264 -111
- package/bin/paths.js +23 -0
- package/bin/paths.mjs +23 -0
- package/package.json +1 -1
- package/scripts/postinstall.mjs +0 -4
- package/.next/standalone/.next/server/chunks/411.js +0 -1
- package/.next/standalone/.next/server/chunks/63.js +0 -13
- package/.next/standalone/.next/server/chunks/724.js +0 -7
- package/.next/standalone/.next/static/chunks/app/(dashboard)/layout-384bfa634ec14bbe.js +0 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/mitm/page-3dca1ab0735aaa0f.js +0 -7
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/antigravity-mitm/settings/route-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/claude-settings/route-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/codex-settings/route-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/copilot-settings/route-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/droid-settings/route-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/cli-tools/opencode-settings/route-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/keys/[id]/route-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/keys/route-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/locale/route-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/models/alias/route-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/models/route-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/providers/route-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/settings/route-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/version/route-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-a42479e2ca7868a9.js +0 -1
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-a4e7c4e324778903.js +0 -1
- package/.next/standalone/.next/static/uPrRUZ-734mcKsKT6Fb28/_buildManifest.js +0 -1
- package/.next/standalone/node_modules/next/dist/server/lib/disk-lru-cache.external.js +0 -57
- package/.next/standalone/node_modules/next/dist/server/lib/postponed-request-body.js +0 -64
- /package/.next/standalone/.next/static/{uPrRUZ-734mcKsKT6Fb28 → rZAYFVGk5tWg3Az1gc9jl}/_ssgManifest.js +0 -0
|
@@ -80,7 +80,6 @@ const _cachebustingsearchparam = require("../shared/lib/router/utils/cache-busti
|
|
|
80
80
|
const _setcachebustingsearchparam = require("../client/components/router-reducer/set-cache-busting-search-param");
|
|
81
81
|
const _fallbackparams = require("./request/fallback-params");
|
|
82
82
|
const _routekind = require("./route-kind");
|
|
83
|
-
const _postponedrequestbody = require("./lib/postponed-request-body");
|
|
84
83
|
function _interop_require_default(obj) {
|
|
85
84
|
return obj && obj.__esModule ? obj : {
|
|
86
85
|
default: obj
|
|
@@ -598,17 +597,32 @@ class Server {
|
|
|
598
597
|
// It's important to execute the following block even it the request
|
|
599
598
|
// matches a pages data route from above.
|
|
600
599
|
if (this.isAppPPREnabled && this.minimalMode && req.headers[_constants2.NEXT_RESUME_HEADER] === '1' && req.method === 'POST') {
|
|
601
|
-
|
|
600
|
+
// Get the configured max postponed state size.
|
|
601
|
+
const maxPostponedStateSize = this.nextConfig.experimental.maxPostponedStateSize ?? _configshared.DEFAULT_MAX_POSTPONED_STATE_SIZE;
|
|
602
|
+
const maxPostponedStateSizeBytes = (0, _configshared.parseMaxPostponedStateSize)(this.nextConfig.experimental.maxPostponedStateSize);
|
|
603
|
+
if (maxPostponedStateSizeBytes === undefined) {
|
|
604
|
+
throw Object.defineProperty(new Error('maxPostponedStateSize must be a valid number (bytes) or filesize format string (e.g., "5mb")'), "__NEXT_ERROR_CODE", {
|
|
605
|
+
value: "E977",
|
|
606
|
+
enumerable: false,
|
|
607
|
+
configurable: true
|
|
608
|
+
});
|
|
609
|
+
}
|
|
602
610
|
// Decode the postponed state from the request body, it will come as
|
|
603
611
|
// an array of buffers, so collect them and then concat them to form
|
|
604
612
|
// the string.
|
|
605
|
-
const body =
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
613
|
+
const body = [];
|
|
614
|
+
let size = 0;
|
|
615
|
+
for await (const chunk of req.body){
|
|
616
|
+
size += Buffer.byteLength(chunk);
|
|
617
|
+
if (size > maxPostponedStateSizeBytes) {
|
|
618
|
+
res.statusCode = 413;
|
|
619
|
+
const errorMessage = `Postponed state exceeded ${maxPostponedStateSize} limit. ` + `To configure the limit, see: https://nextjs.org/docs/app/api-reference/config/next-config-js/max-postponed-state-size`;
|
|
620
|
+
res.body(errorMessage).send();
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
body.push(chunk);
|
|
610
624
|
}
|
|
611
|
-
const postponed = body.toString('utf8');
|
|
625
|
+
const postponed = Buffer.concat(body).toString('utf8');
|
|
612
626
|
(0, _requestmeta.addRequestMeta)(req, 'postponed', postponed);
|
|
613
627
|
}
|
|
614
628
|
// If the request is a next data request and it has a postponed state,
|
|
@@ -532,7 +532,6 @@ const configSchema = _zod.z.lazy(()=>_zod.z.strictObject({
|
|
|
532
532
|
imageSizes: _zod.z.array(_zod.z.number().int().gte(1).lte(10000)).min(0).max(25).optional(),
|
|
533
533
|
loader: _zod.z.enum(_imageconfig.VALID_LOADERS).optional(),
|
|
534
534
|
loaderFile: _zod.z.string().optional(),
|
|
535
|
-
maximumDiskCacheSize: _zod.z.number().int().min(0).optional(),
|
|
536
535
|
maximumRedirects: _zod.z.number().int().min(0).max(20).optional(),
|
|
537
536
|
maximumResponseBody: _zod.z.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional(),
|
|
538
537
|
minimumCacheTTL: _zod.z.number().int().gte(0).optional(),
|
|
@@ -153,7 +153,7 @@ async function createHotReloaderTurbopack(opts, serverFields, distDir, resetFetc
|
|
|
153
153
|
}
|
|
154
154
|
const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
|
|
155
155
|
const hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
|
156
|
-
version: "16.1.
|
|
156
|
+
version: "16.1.6"
|
|
157
157
|
});
|
|
158
158
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
159
159
|
// of the current `next dev` invocation.
|
|
@@ -233,7 +233,7 @@ class HotReloaderWebpack {
|
|
|
233
233
|
this.previewProps = previewProps;
|
|
234
234
|
this.rewrites = rewrites;
|
|
235
235
|
this.hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
|
236
|
-
version: "16.1.
|
|
236
|
+
version: "16.1.6"
|
|
237
237
|
});
|
|
238
238
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
239
239
|
// of the current `next dev` invocation.
|
|
@@ -91,7 +91,6 @@ const _servestatic = require("./serve-static");
|
|
|
91
91
|
const _log = /*#__PURE__*/ _interop_require_wildcard(require("../build/output/log"));
|
|
92
92
|
const _iserror = /*#__PURE__*/ _interop_require_default(require("../lib/is-error"));
|
|
93
93
|
const _isprivateip = require("./is-private-ip");
|
|
94
|
-
const _disklrucacheexternal = require("./lib/disk-lru-cache.external");
|
|
95
94
|
const _url1 = require("../lib/url");
|
|
96
95
|
const _invarianterror = require("../shared/lib/invariant-error");
|
|
97
96
|
const _promises = require("dns/promises");
|
|
@@ -176,24 +175,6 @@ const BLUR_IMG_SIZE = 8 // should match `next-image-loader`
|
|
|
176
175
|
const BLUR_QUALITY = 70 // should match `next-image-loader`
|
|
177
176
|
;
|
|
178
177
|
let _sharp;
|
|
179
|
-
async function initCacheEntries(cacheDir) {
|
|
180
|
-
const cacheKeys = await _fs.promises.readdir(cacheDir).catch(()=>[]);
|
|
181
|
-
const entries = [];
|
|
182
|
-
for (const cacheKey of cacheKeys){
|
|
183
|
-
try {
|
|
184
|
-
const { expireAt, buffer } = await readFromCacheDir(cacheDir, cacheKey);
|
|
185
|
-
entries.push({
|
|
186
|
-
key: cacheKey,
|
|
187
|
-
size: buffer.byteLength,
|
|
188
|
-
expireAt
|
|
189
|
-
});
|
|
190
|
-
} catch {
|
|
191
|
-
// Skip entries that can't be read from disk
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
// Sort oldest-first so we can replay them chronologically into LRU
|
|
195
|
-
return entries.sort((a, b)=>a.expireAt - b.expireAt);
|
|
196
|
-
}
|
|
197
178
|
function getSharp(concurrency) {
|
|
198
179
|
if (_sharp) {
|
|
199
180
|
return _sharp;
|
|
@@ -247,8 +228,7 @@ function getImageEtag(image) {
|
|
|
247
228
|
image
|
|
248
229
|
]);
|
|
249
230
|
}
|
|
250
|
-
async function writeToCacheDir(
|
|
251
|
-
const dir = (0, _path.join)(/* turbopackIgnore: true */ cacheDir, cacheKey);
|
|
231
|
+
async function writeToCacheDir(dir, extension, maxAge, expireAt, buffer, etag, upstreamEtag) {
|
|
252
232
|
const filename = (0, _path.join)(/* turbopackIgnore: true */ dir, `${maxAge}.${expireAt}.${etag}.${upstreamEtag}.${extension}`);
|
|
253
233
|
await _fs.promises.rm(dir, {
|
|
254
234
|
recursive: true,
|
|
@@ -259,39 +239,6 @@ async function writeToCacheDir(cacheDir, cacheKey, extension, maxAge, expireAt,
|
|
|
259
239
|
});
|
|
260
240
|
await _fs.promises.writeFile(filename, buffer);
|
|
261
241
|
}
|
|
262
|
-
async function readFromCacheDir(cacheDir, cacheKey) {
|
|
263
|
-
const dir = (0, _path.join)(/* turbopackIgnore: true */ cacheDir, cacheKey);
|
|
264
|
-
const files = await _fs.promises.readdir(dir);
|
|
265
|
-
const file = files[0];
|
|
266
|
-
if (!file) {
|
|
267
|
-
throw Object.defineProperty(new Error(`Invariant: cache entry "${cacheKey}" not found in dir "${cacheDir}"`), "__NEXT_ERROR_CODE", {
|
|
268
|
-
value: "E978",
|
|
269
|
-
enumerable: false,
|
|
270
|
-
configurable: true
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
const [maxAgeSt, expireAtSt, etag, upstreamEtag, extension] = file.split('.', 5);
|
|
274
|
-
const filePath = (0, _path.join)(/* turbopackIgnore: true */ dir, file);
|
|
275
|
-
const buffer = await _fs.promises.readFile(/* turbopackIgnore: true */ filePath);
|
|
276
|
-
const expireAt = Number(expireAtSt);
|
|
277
|
-
const maxAge = Number(maxAgeSt);
|
|
278
|
-
return {
|
|
279
|
-
maxAge,
|
|
280
|
-
expireAt,
|
|
281
|
-
etag,
|
|
282
|
-
upstreamEtag,
|
|
283
|
-
buffer,
|
|
284
|
-
extension
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
async function deleteFromCacheDir(cacheDir, cacheKey) {
|
|
288
|
-
return _fs.promises.rm((0, _path.join)(/* turbopackIgnore: true */ cacheDir, cacheKey), {
|
|
289
|
-
recursive: true,
|
|
290
|
-
force: true
|
|
291
|
-
}).catch((err)=>{
|
|
292
|
-
_log.error(`Failed to delete cache key ${cacheKey}`, err);
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
242
|
async function detectContentType(buffer, skipMetadata, concurrency) {
|
|
296
243
|
if (buffer.byteLength === 0) {
|
|
297
244
|
return null;
|
|
@@ -683,75 +630,36 @@ class ImageOptimizerCache {
|
|
|
683
630
|
mimeType
|
|
684
631
|
]);
|
|
685
632
|
}
|
|
686
|
-
constructor({ distDir, nextConfig
|
|
633
|
+
constructor({ distDir, nextConfig }){
|
|
687
634
|
this.cacheDir = (0, _path.join)(/* turbopackIgnore: true */ distDir, 'cache', 'images');
|
|
688
635
|
this.nextConfig = nextConfig;
|
|
689
|
-
this.cacheHandler = cacheHandler;
|
|
690
|
-
// Eagerly start LRU initialization for filesystem cache
|
|
691
|
-
if (!cacheHandler && nextConfig.images.maximumDiskCacheSize !== 0 && nextConfig.experimental.isrFlushToDisk) {
|
|
692
|
-
this.isDiskCacheEnabled = true;
|
|
693
|
-
this.cacheDiskLRU = (0, _disklrucacheexternal.getOrInitDiskLRU)(this.cacheDir, nextConfig.images.maximumDiskCacheSize, initCacheEntries, deleteFromCacheDir);
|
|
694
|
-
}
|
|
695
636
|
}
|
|
696
637
|
async get(cacheKey) {
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
}
|
|
707
|
-
if (cacheData.value.kind !== _responsecache.CachedRouteKind.IMAGE) {
|
|
708
|
-
return null;
|
|
709
|
-
}
|
|
710
|
-
const now = Date.now();
|
|
711
|
-
const lastModified = cacheData.lastModified || now;
|
|
712
|
-
const revalidate = typeof cacheData.value.revalidate === 'number' ? cacheData.value.revalidate : this.nextConfig.images.minimumCacheTTL;
|
|
713
|
-
const revalidateAfter = Math.max(revalidate, this.nextConfig.images.minimumCacheTTL) * 1000 + lastModified;
|
|
714
|
-
const isStale = revalidateAfter < now;
|
|
638
|
+
try {
|
|
639
|
+
const cacheDir = (0, _path.join)(/* turbopackIgnore: true */ this.cacheDir, cacheKey);
|
|
640
|
+
const files = await _fs.promises.readdir(cacheDir);
|
|
641
|
+
const now = Date.now();
|
|
642
|
+
for (const file of files){
|
|
643
|
+
const [maxAgeSt, expireAtSt, etag, upstreamEtag, extension] = file.split('.', 5);
|
|
644
|
+
const buffer = await _fs.promises.readFile(/* turbopackIgnore: true */ (0, _path.join)(/* turbopackIgnore: true */ cacheDir, file));
|
|
645
|
+
const expireAt = Number(expireAtSt);
|
|
646
|
+
const maxAge = Number(maxAgeSt);
|
|
715
647
|
return {
|
|
716
|
-
value:
|
|
717
|
-
|
|
648
|
+
value: {
|
|
649
|
+
kind: _responsecache.CachedRouteKind.IMAGE,
|
|
650
|
+
etag,
|
|
651
|
+
buffer,
|
|
652
|
+
extension,
|
|
653
|
+
upstreamEtag
|
|
654
|
+
},
|
|
655
|
+
revalidateAfter: Math.max(maxAge, this.nextConfig.images.minimumCacheTTL) * 1000 + Date.now(),
|
|
718
656
|
cacheControl: {
|
|
719
|
-
revalidate,
|
|
657
|
+
revalidate: maxAge,
|
|
720
658
|
expire: undefined
|
|
721
659
|
},
|
|
722
|
-
isStale
|
|
660
|
+
isStale: now > expireAt
|
|
723
661
|
};
|
|
724
|
-
} catch (_) {
|
|
725
|
-
// failed to get from custom cache handler, treat as cache miss
|
|
726
662
|
}
|
|
727
|
-
return null;
|
|
728
|
-
}
|
|
729
|
-
// If the filesystem cache is disabled, return early
|
|
730
|
-
if (!this.isDiskCacheEnabled) {
|
|
731
|
-
return null;
|
|
732
|
-
}
|
|
733
|
-
// Fall back to filesystem cache
|
|
734
|
-
try {
|
|
735
|
-
const now = Date.now();
|
|
736
|
-
const { maxAge, expireAt, etag, upstreamEtag, buffer, extension } = await readFromCacheDir(this.cacheDir, cacheKey);
|
|
737
|
-
// Promote entry in LRU (mark as recently used)
|
|
738
|
-
const lru = await this.cacheDiskLRU;
|
|
739
|
-
lru == null ? void 0 : lru.get(cacheKey);
|
|
740
|
-
return {
|
|
741
|
-
value: {
|
|
742
|
-
kind: _responsecache.CachedRouteKind.IMAGE,
|
|
743
|
-
etag,
|
|
744
|
-
buffer,
|
|
745
|
-
extension,
|
|
746
|
-
upstreamEtag
|
|
747
|
-
},
|
|
748
|
-
revalidateAfter: Math.max(maxAge, this.nextConfig.images.minimumCacheTTL) * 1000 + Date.now(),
|
|
749
|
-
cacheControl: {
|
|
750
|
-
revalidate: maxAge,
|
|
751
|
-
expire: undefined
|
|
752
|
-
},
|
|
753
|
-
isStale: now > expireAt
|
|
754
|
-
};
|
|
755
663
|
} catch (_) {
|
|
756
664
|
// failed to read from cache dir, treat as cache miss
|
|
757
665
|
}
|
|
@@ -776,43 +684,9 @@ class ImageOptimizerCache {
|
|
|
776
684
|
configurable: true
|
|
777
685
|
});
|
|
778
686
|
}
|
|
779
|
-
// If a custom cache handler is provided, use it
|
|
780
|
-
if (this.cacheHandler) {
|
|
781
|
-
try {
|
|
782
|
-
// Apply minimumCacheTTL at write time, similar to the implementation in the fallback filesystem cache
|
|
783
|
-
const effectiveRevalidate = Math.max(revalidate, this.nextConfig.images.minimumCacheTTL);
|
|
784
|
-
const valueWithRevalidate = {
|
|
785
|
-
...value,
|
|
786
|
-
revalidate: effectiveRevalidate
|
|
787
|
-
};
|
|
788
|
-
await this.cacheHandler.set(cacheKey, valueWithRevalidate, {
|
|
789
|
-
cacheControl: {
|
|
790
|
-
revalidate: effectiveRevalidate,
|
|
791
|
-
expire: cacheControl == null ? void 0 : cacheControl.expire
|
|
792
|
-
}
|
|
793
|
-
});
|
|
794
|
-
} catch (err) {
|
|
795
|
-
_log.error(`Failed to write image to custom cache ${cacheKey}`, err);
|
|
796
|
-
}
|
|
797
|
-
return;
|
|
798
|
-
}
|
|
799
|
-
// If the filesystem cache is disabled, return early
|
|
800
|
-
if (!this.isDiskCacheEnabled) {
|
|
801
|
-
return;
|
|
802
|
-
}
|
|
803
|
-
// Fall back to filesystem cache
|
|
804
687
|
const expireAt = Math.max(revalidate, this.nextConfig.images.minimumCacheTTL) * 1000 + Date.now();
|
|
805
688
|
try {
|
|
806
|
-
|
|
807
|
-
const success = lru == null ? void 0 : lru.set(cacheKey, value.buffer.byteLength);
|
|
808
|
-
if (success === false) {
|
|
809
|
-
throw Object.defineProperty(new Error(`image of size ${value.buffer.byteLength} could not be tracked by lru cache`), "__NEXT_ERROR_CODE", {
|
|
810
|
-
value: "E979",
|
|
811
|
-
enumerable: false,
|
|
812
|
-
configurable: true
|
|
813
|
-
});
|
|
814
|
-
}
|
|
815
|
-
await writeToCacheDir(this.cacheDir, cacheKey, value.extension, revalidate, expireAt, value.buffer, value.etag, value.upstreamEtag);
|
|
689
|
+
await writeToCacheDir((0, _path.join)(/* turbopackIgnore: true */ this.cacheDir, cacheKey), value.extension, revalidate, expireAt, value.buffer, value.etag, value.upstreamEtag);
|
|
816
690
|
} catch (err) {
|
|
817
691
|
_log.error(`Failed to write image to cache ${cacheKey}`, err);
|
|
818
692
|
}
|
|
@@ -91,7 +91,7 @@ function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures, logBu
|
|
|
91
91
|
if (parts.length > 0) {
|
|
92
92
|
versionSuffix = ` (${parts.join(', ')})`;
|
|
93
93
|
}
|
|
94
|
-
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.1.
|
|
94
|
+
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.1.6"}`))}${versionSuffix}`);
|
|
95
95
|
if (appUrl) {
|
|
96
96
|
_log.bootstrap(`- Local: ${appUrl}`);
|
|
97
97
|
}
|
|
@@ -92,7 +92,7 @@ class LRUCache {
|
|
|
92
92
|
const size = (this.calculateSize == null ? void 0 : this.calculateSize.call(this, value)) ?? 1;
|
|
93
93
|
if (size > this.maxSize) {
|
|
94
94
|
console.warn('Single item size exceeds maxSize');
|
|
95
|
-
return
|
|
95
|
+
return;
|
|
96
96
|
}
|
|
97
97
|
const existing = this.cache.get(key);
|
|
98
98
|
if (existing) {
|
|
@@ -115,7 +115,6 @@ class LRUCache {
|
|
|
115
115
|
this.totalSize -= tail.size;
|
|
116
116
|
this.onEvict == null ? void 0 : this.onEvict.call(this, tail.key, tail.data);
|
|
117
117
|
}
|
|
118
|
-
return true;
|
|
119
118
|
}
|
|
120
119
|
/**
|
|
121
120
|
* Checks if a key exists in the cache.
|
|
@@ -140,7 +140,7 @@ async function createCachedPrerenderResponse(res, cacheKey, incrementalCacheCont
|
|
|
140
140
|
statusText: res.statusText
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
|
-
async function createCachedDynamicResponse(workStore, res, cacheKey, incrementalCacheContext, incrementalCache, serverComponentsHmrCache, revalidate, input, handleUnlock
|
|
143
|
+
async function createCachedDynamicResponse(workStore, res, cacheKey, incrementalCacheContext, incrementalCache, serverComponentsHmrCache, revalidate, input, handleUnlock) {
|
|
144
144
|
// We're cloning the response using this utility because there exists a bug in
|
|
145
145
|
// the undici library around response cloning. See the following pull request
|
|
146
146
|
// for more details: https://github.com/vercel/next.js/pull/73274
|
|
@@ -164,12 +164,7 @@ async function createCachedDynamicResponse(workStore, res, cacheKey, incremental
|
|
|
164
164
|
revalidate
|
|
165
165
|
}, incrementalCacheContext);
|
|
166
166
|
}
|
|
167
|
-
}).catch((error)=>
|
|
168
|
-
// Don't warn if the request was aborted intentionally.
|
|
169
|
-
if (!(signal == null ? void 0 : signal.aborted)) {
|
|
170
|
-
console.warn(`Failed to set fetch cache`, input, error);
|
|
171
|
-
}
|
|
172
|
-
}).finally(handleUnlock);
|
|
167
|
+
}).catch((error)=>console.warn(`Failed to set fetch cache`, input, error)).finally(handleUnlock);
|
|
173
168
|
const pendingRevalidateKey = `cache-set-${cacheKey}`;
|
|
174
169
|
const pendingRevalidates = workStore.pendingRevalidates ??= {};
|
|
175
170
|
let pendingRevalidatePromise = Promise.resolve();
|
|
@@ -643,13 +638,9 @@ function createPatchedFetcher(originFetch, { workAsyncStorage, workUnitAsyncStor
|
|
|
643
638
|
case 'prerender-runtime':
|
|
644
639
|
return createCachedPrerenderResponse(res, cacheKey, incrementalCacheConfig, incrementalCache, normalizedRevalidate, handleUnlock);
|
|
645
640
|
case 'request':
|
|
646
|
-
if (process.env.NODE_ENV === 'development' && workUnitStore.stagedRendering && workUnitStore.cacheSignal
|
|
647
|
-
// We're filling caches for a staged render
|
|
648
|
-
//
|
|
649
|
-
// response to finish instead of streaming. For HMR-only
|
|
650
|
-
// caching (no explicit revalidate), we fall through to
|
|
651
|
-
// createCachedDynamicResponse which handles streaming
|
|
652
|
-
// and abort gracefully.
|
|
641
|
+
if (process.env.NODE_ENV === 'development' && workUnitStore.stagedRendering && workUnitStore.cacheSignal) {
|
|
642
|
+
// We're filling caches for a staged render,
|
|
643
|
+
// so we need to wait for the response to finish instead of streaming.
|
|
653
644
|
return createCachedPrerenderResponse(res, cacheKey, incrementalCacheConfig, incrementalCache, normalizedRevalidate, handleUnlock);
|
|
654
645
|
}
|
|
655
646
|
// fallthrough
|
|
@@ -659,7 +650,7 @@ function createPatchedFetcher(originFetch, { workAsyncStorage, workUnitAsyncStor
|
|
|
659
650
|
case 'private-cache':
|
|
660
651
|
case 'unstable-cache':
|
|
661
652
|
case undefined:
|
|
662
|
-
return createCachedDynamicResponse(workStore, res, cacheKey, incrementalCacheConfig, incrementalCache, serverComponentsHmrCache, normalizedRevalidate, input, handleUnlock
|
|
653
|
+
return createCachedDynamicResponse(workStore, res, cacheKey, incrementalCacheConfig, incrementalCache, serverComponentsHmrCache, normalizedRevalidate, input, handleUnlock);
|
|
663
654
|
default:
|
|
664
655
|
workUnitStore;
|
|
665
656
|
}
|
|
@@ -43,7 +43,7 @@ const _hotreloadertypes = require("../dev/hot-reloader-types");
|
|
|
43
43
|
const _normalizedassetprefix = require("../../shared/lib/normalized-asset-prefix");
|
|
44
44
|
const _patchfetch = require("./patch-fetch");
|
|
45
45
|
const _utils1 = require("./server-ipc/utils");
|
|
46
|
-
const
|
|
46
|
+
const _blockcrosssite = require("./router-utils/block-cross-site");
|
|
47
47
|
const _shared = require("../../trace/shared");
|
|
48
48
|
const _nofallbackerrorexternal = require("../../shared/lib/no-fallback-error.external");
|
|
49
49
|
const _routerservercontext = require("./router-utils/router-server-context");
|
|
@@ -275,7 +275,7 @@ async function initialize(opts) {
|
|
|
275
275
|
}
|
|
276
276
|
// handle hot-reloader first
|
|
277
277
|
if (development) {
|
|
278
|
-
if ((0,
|
|
278
|
+
if ((0, _blockcrosssite.blockCrossSite)(req, res, development.config.allowedDevOrigins, opts.hostname)) {
|
|
279
279
|
return;
|
|
280
280
|
}
|
|
281
281
|
const origUrl = req.url || '/';
|
|
@@ -591,7 +591,7 @@ async function initialize(opts) {
|
|
|
591
591
|
// console.error(_err);
|
|
592
592
|
});
|
|
593
593
|
if (opts.dev && development && req.url) {
|
|
594
|
-
if ((0,
|
|
594
|
+
if ((0, _blockcrosssite.blockCrossSite)(req, socket, development.config.allowedDevOrigins, opts.hostname)) {
|
|
595
595
|
return;
|
|
596
596
|
}
|
|
597
597
|
const { basePath, assetPrefix } = config;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
Object.defineProperty(exports, "
|
|
5
|
+
Object.defineProperty(exports, "blockCrossSite", {
|
|
6
6
|
enumerable: true,
|
|
7
7
|
get: function() {
|
|
8
|
-
return
|
|
8
|
+
return blockCrossSite;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _url = require("../../../lib/url");
|
|
@@ -24,7 +24,7 @@ function warnOrBlockRequest(res, origin, mode) {
|
|
|
24
24
|
res.end('Unauthorized');
|
|
25
25
|
return true;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function isInternalDevEndpoint(req) {
|
|
28
28
|
if (!req.url) return false;
|
|
29
29
|
try {
|
|
30
30
|
// TODO: We should standardize on a single prefix for this
|
|
@@ -38,7 +38,7 @@ function isInternalEndpoint(req) {
|
|
|
38
38
|
return false;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
const
|
|
41
|
+
const blockCrossSite = (req, res, allowedDevOrigins, hostname)=>{
|
|
42
42
|
// in the future, these will be blocked by default when allowed origins aren't configured.
|
|
43
43
|
// for now, we warn when allowed origins aren't configured
|
|
44
44
|
const mode = typeof allowedDevOrigins === 'undefined' ? 'warn' : 'block';
|
|
@@ -51,7 +51,7 @@ const blockCrossSiteDEV = (req, res, allowedDevOrigins, hostname)=>{
|
|
|
51
51
|
allowedOrigins.push(hostname);
|
|
52
52
|
}
|
|
53
53
|
// only process internal URLs/middleware
|
|
54
|
-
if (!
|
|
54
|
+
if (!isInternalDevEndpoint(req)) {
|
|
55
55
|
return false;
|
|
56
56
|
}
|
|
57
57
|
// block non-cors request from cross-site e.g. script tag on
|
|
@@ -59,12 +59,18 @@ const blockCrossSiteDEV = (req, res, allowedDevOrigins, hostname)=>{
|
|
|
59
59
|
if (req.headers['sec-fetch-mode'] === 'no-cors' && req.headers['sec-fetch-site'] === 'cross-site') {
|
|
60
60
|
return warnOrBlockRequest(res, undefined, mode);
|
|
61
61
|
}
|
|
62
|
-
// ensure websocket requests
|
|
62
|
+
// ensure websocket requests from allowed origin
|
|
63
63
|
const rawOrigin = req.headers['origin'];
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
if (rawOrigin && rawOrigin !== 'null') {
|
|
65
|
+
const parsedOrigin = (0, _url.parseUrl)(rawOrigin);
|
|
66
|
+
if (parsedOrigin) {
|
|
67
|
+
const originLowerCase = parsedOrigin.hostname.toLowerCase();
|
|
68
|
+
if (!(0, _csrfprotection.isCsrfOriginAllowed)(originLowerCase, allowedOrigins)) {
|
|
69
|
+
return warnOrBlockRequest(res, originLowerCase, mode);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return false;
|
|
68
74
|
};
|
|
69
75
|
|
|
70
|
-
//# sourceMappingURL=block-cross-site
|
|
76
|
+
//# sourceMappingURL=block-cross-site.js.map
|
|
@@ -179,7 +179,7 @@ async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup, server
|
|
|
179
179
|
async function startServer(serverOptions) {
|
|
180
180
|
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
|
|
181
181
|
let { port } = serverOptions;
|
|
182
|
-
process.title = `next-server (v${"16.1.
|
|
182
|
+
process.title = `next-server (v${"16.1.6"})`;
|
|
183
183
|
let handlersReady = ()=>{};
|
|
184
184
|
let handlersError = ()=>{};
|
|
185
185
|
let handlersPromise = new Promise((resolve, reject)=>{
|
package/.next/standalone/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js
CHANGED
|
@@ -21,7 +21,7 @@ _export(exports, {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
function isStableBuild() {
|
|
24
|
-
return !"16.1.
|
|
24
|
+
return !"16.1.6"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
|
|
25
25
|
}
|
|
26
26
|
class CanaryOnlyConfigError extends Error {
|
|
27
27
|
constructor(arg){
|
|
@@ -12,12 +12,12 @@ const EVENT_VERSION = 'NEXT_CLI_SESSION_STARTED';
|
|
|
12
12
|
function eventCliSession(nextConfig, event) {
|
|
13
13
|
var _nextConfig_experimental_staleTimes, _nextConfig_experimental_staleTimes1, _nextConfig_reactCompiler, _nextConfig_reactCompiler1;
|
|
14
14
|
// This should be an invariant, if it fails our build tooling is broken.
|
|
15
|
-
if (typeof "16.1.
|
|
15
|
+
if (typeof "16.1.6" !== 'string') {
|
|
16
16
|
return [];
|
|
17
17
|
}
|
|
18
18
|
const { images, i18n } = nextConfig || {};
|
|
19
19
|
const payload = {
|
|
20
|
-
nextVersion: "16.1.
|
|
20
|
+
nextVersion: "16.1.6",
|
|
21
21
|
nodeVersion: process.version,
|
|
22
22
|
cliCommand: event.cliCommand,
|
|
23
23
|
isSrcDir: event.isSrcDir,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next",
|
|
3
|
-
"version": "16.1.
|
|
3
|
+
"version": "16.1.6",
|
|
4
4
|
"description": "The React Framework",
|
|
5
5
|
"main": "./dist/server/next.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
]
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
|
-
"@next/env": "16.1.
|
|
100
|
+
"@next/env": "16.1.6",
|
|
101
101
|
"@swc/helpers": "0.5.15",
|
|
102
|
-
"baseline-browser-mapping": "^2.
|
|
102
|
+
"baseline-browser-mapping": "^2.8.3",
|
|
103
103
|
"caniuse-lite": "^1.0.30001579",
|
|
104
104
|
"postcss": "8.4.31",
|
|
105
105
|
"styled-jsx": "5.1.6"
|
|
@@ -128,14 +128,14 @@
|
|
|
128
128
|
},
|
|
129
129
|
"optionalDependencies": {
|
|
130
130
|
"sharp": "^0.34.4",
|
|
131
|
-
"@next/swc-darwin-arm64": "16.1.
|
|
132
|
-
"@next/swc-darwin-x64": "16.1.
|
|
133
|
-
"@next/swc-linux-arm64-gnu": "16.1.
|
|
134
|
-
"@next/swc-linux-arm64-musl": "16.1.
|
|
135
|
-
"@next/swc-linux-x64-gnu": "16.1.
|
|
136
|
-
"@next/swc-linux-x64-musl": "16.1.
|
|
137
|
-
"@next/swc-win32-arm64-msvc": "16.1.
|
|
138
|
-
"@next/swc-win32-x64-msvc": "16.1.
|
|
131
|
+
"@next/swc-darwin-arm64": "16.1.6",
|
|
132
|
+
"@next/swc-darwin-x64": "16.1.6",
|
|
133
|
+
"@next/swc-linux-arm64-gnu": "16.1.6",
|
|
134
|
+
"@next/swc-linux-arm64-musl": "16.1.6",
|
|
135
|
+
"@next/swc-linux-x64-gnu": "16.1.6",
|
|
136
|
+
"@next/swc-linux-x64-musl": "16.1.6",
|
|
137
|
+
"@next/swc-win32-arm64-msvc": "16.1.6",
|
|
138
|
+
"@next/swc-win32-x64-msvc": "16.1.6"
|
|
139
139
|
},
|
|
140
140
|
"devDependencies": {
|
|
141
141
|
"@babel/code-frame": "7.26.2",
|
|
@@ -170,11 +170,11 @@
|
|
|
170
170
|
"@modelcontextprotocol/sdk": "1.18.1",
|
|
171
171
|
"@mswjs/interceptors": "0.23.0",
|
|
172
172
|
"@napi-rs/triples": "1.2.0",
|
|
173
|
-
"@next/font": "16.1.
|
|
174
|
-
"@next/polyfill-module": "16.1.
|
|
175
|
-
"@next/polyfill-nomodule": "16.1.
|
|
176
|
-
"@next/react-refresh-utils": "16.1.
|
|
177
|
-
"@next/swc": "16.1.
|
|
173
|
+
"@next/font": "16.1.6",
|
|
174
|
+
"@next/polyfill-module": "16.1.6",
|
|
175
|
+
"@next/polyfill-nomodule": "16.1.6",
|
|
176
|
+
"@next/react-refresh-utils": "16.1.6",
|
|
177
|
+
"@next/swc": "16.1.6",
|
|
178
178
|
"@opentelemetry/api": "1.6.0",
|
|
179
179
|
"@playwright/test": "1.51.1",
|
|
180
180
|
"@rspack/core": "1.6.7",
|