@netlify/plugin-nextjs 5.0.0-rc.2 → 5.0.0-rc.4
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/README.md +16 -0
- package/dist/build/content/prerendered.js +1 -1
- package/dist/build/content/server.js +5 -1
- package/dist/build/content/static.js +1 -1
- package/dist/build/functions/edge.js +2 -2
- package/dist/build/functions/server.js +5 -3
- package/dist/build/plugin-context.js +1 -1
- package/dist/build/verification.js +18 -0
- package/dist/esm-chunks/{chunk-MPZEWLBG.js → chunk-3IGTKVSS.js} +4 -2
- package/dist/esm-chunks/{chunk-655Y7ISI.js → chunk-3NYX5FXN.js} +30 -33
- package/dist/esm-chunks/{chunk-UTCWWUFW.js → chunk-637Y3P2U.js} +99 -65
- package/dist/esm-chunks/chunk-7CY6B4WT.js +61 -0
- package/dist/esm-chunks/{chunk-E3NFUTWC.js → chunk-7HI65MAI.js} +7 -5
- package/dist/esm-chunks/{chunk-52WMBYKL.js → chunk-BKDCZVBK.js} +56 -8
- package/dist/esm-chunks/chunk-GQ6KIYPX.js +1658 -0
- package/dist/esm-chunks/{chunk-ZZOGIP2V.js → chunk-OBKVBMAL.js} +27 -34
- package/dist/esm-chunks/chunk-PJG75HGC.js +2454 -0
- package/dist/esm-chunks/{chunk-67EWAGDQ.js → chunk-VSH4JS2L.js} +18 -6
- package/dist/esm-chunks/{package-V53S3A76.js → package-K6MJITES.js} +10 -5
- package/dist/index.js +13 -7
- package/dist/run/handlers/cache.cjs +878 -1722
- package/dist/run/handlers/server.js +25 -9
- package/dist/run/handlers/tracing.js +5249 -6840
- package/dist/run/headers.js +1 -1
- package/dist/run/next.cjs +863 -1717
- package/package.json +2 -10
- package/dist/esm-chunks/chunk-VDDK7MXY.js +0 -1661
|
@@ -5,8 +5,13 @@
|
|
|
5
5
|
})();
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
SpanStatusCode,
|
|
9
|
+
init_esm,
|
|
10
|
+
trace
|
|
11
|
+
} from "../../esm-chunks/chunk-GQ6KIYPX.js";
|
|
12
|
+
import {
|
|
13
|
+
nextResponseProxy
|
|
14
|
+
} from "../../esm-chunks/chunk-RL4K4CVH.js";
|
|
10
15
|
import {
|
|
11
16
|
import_internal
|
|
12
17
|
} from "../../esm-chunks/chunk-HYBEXB2Z.js";
|
|
@@ -20,11 +25,8 @@ import {
|
|
|
20
25
|
setCacheStatusHeader,
|
|
21
26
|
setCacheTagsHeaders,
|
|
22
27
|
setVaryHeaders
|
|
23
|
-
} from "../../esm-chunks/chunk-
|
|
28
|
+
} from "../../esm-chunks/chunk-637Y3P2U.js";
|
|
24
29
|
import "../../esm-chunks/chunk-TYCYFZ22.js";
|
|
25
|
-
import {
|
|
26
|
-
nextResponseProxy
|
|
27
|
-
} from "../../esm-chunks/chunk-RL4K4CVH.js";
|
|
28
30
|
import {
|
|
29
31
|
__commonJS,
|
|
30
32
|
__toESM
|
|
@@ -3260,13 +3262,26 @@ function toComputeResponse(res) {
|
|
|
3260
3262
|
}
|
|
3261
3263
|
|
|
3262
3264
|
// src/run/handlers/server.ts
|
|
3263
|
-
|
|
3265
|
+
init_esm();
|
|
3264
3266
|
import { createRequestContext, runWithRequestContext } from "./request-context.cjs";
|
|
3265
3267
|
var nextHandler;
|
|
3266
3268
|
var nextConfig;
|
|
3267
3269
|
var tagsManifest;
|
|
3270
|
+
var disableFaultyTransferEncodingHandling = (res) => {
|
|
3271
|
+
const originalStoreHeader = res._storeHeader;
|
|
3272
|
+
res._storeHeader = function _storeHeader(firstLine, headers) {
|
|
3273
|
+
if (headers) {
|
|
3274
|
+
if (Array.isArray(headers)) {
|
|
3275
|
+
headers = headers.filter(([header]) => header.toLowerCase() !== "transfer-encoding");
|
|
3276
|
+
} else {
|
|
3277
|
+
delete headers["transfer-encoding"];
|
|
3278
|
+
}
|
|
3279
|
+
}
|
|
3280
|
+
return originalStoreHeader.call(this, firstLine, headers);
|
|
3281
|
+
};
|
|
3282
|
+
};
|
|
3268
3283
|
var server_default = async (request) => {
|
|
3269
|
-
const tracer =
|
|
3284
|
+
const tracer = trace.getTracer("Next.js Runtime");
|
|
3270
3285
|
if (!nextHandler) {
|
|
3271
3286
|
await tracer.startActiveSpan("initialize next server", async (span) => {
|
|
3272
3287
|
const { getRunConfig, setRunConfig } = await import("../config.js");
|
|
@@ -3293,6 +3308,7 @@ var server_default = async (request) => {
|
|
|
3293
3308
|
return await tracer.startActiveSpan("generate response", async (span) => {
|
|
3294
3309
|
const { req, res } = toReqRes(request);
|
|
3295
3310
|
const requestContext = createRequestContext();
|
|
3311
|
+
disableFaultyTransferEncodingHandling(res);
|
|
3296
3312
|
const resProxy = nextResponseProxy(res, requestContext);
|
|
3297
3313
|
const nextHandlerPromise = runWithRequestContext(
|
|
3298
3314
|
requestContext,
|
|
@@ -3303,7 +3319,7 @@ var server_default = async (request) => {
|
|
|
3303
3319
|
span.recordException(error);
|
|
3304
3320
|
span.setAttribute("http.status_code", 500);
|
|
3305
3321
|
span.setStatus({
|
|
3306
|
-
code:
|
|
3322
|
+
code: SpanStatusCode.ERROR,
|
|
3307
3323
|
message: error instanceof Error ? error.message : String(error)
|
|
3308
3324
|
});
|
|
3309
3325
|
span.end();
|