@opennextjs/cloudflare 0.2.1 → 0.3.1

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.
Files changed (100) hide show
  1. package/README.md +48 -38
  2. package/dist/api/{get-cloudflare-context.d.mts → get-cloudflare-context.d.ts} +4 -4
  3. package/dist/api/get-cloudflare-context.js +39 -0
  4. package/dist/api/index.d.ts +1 -0
  5. package/dist/api/index.js +1 -0
  6. package/dist/api/kvCache.d.ts +27 -0
  7. package/dist/api/kvCache.js +121 -0
  8. package/dist/cli/args.d.ts +5 -0
  9. package/dist/cli/args.js +48 -0
  10. package/dist/cli/build/bundle-server.d.ts +6 -0
  11. package/dist/cli/build/bundle-server.js +188 -0
  12. package/dist/cli/build/index.d.ts +9 -0
  13. package/dist/cli/build/index.js +123 -0
  14. package/dist/cli/build/open-next/compile-env-files.d.ts +5 -0
  15. package/dist/cli/build/open-next/compile-env-files.js +9 -0
  16. package/dist/cli/build/open-next/copyCacheAssets.d.ts +2 -0
  17. package/dist/cli/build/open-next/copyCacheAssets.js +10 -0
  18. package/dist/cli/build/open-next/createServerBundle.d.ts +2 -0
  19. package/dist/cli/build/open-next/createServerBundle.js +216 -0
  20. package/dist/cli/build/patches/index.d.ts +2 -0
  21. package/dist/cli/build/patches/index.js +2 -0
  22. package/dist/cli/build/patches/investigated/copy-package-cli-files.d.ts +6 -0
  23. package/dist/cli/build/patches/investigated/copy-package-cli-files.js +12 -0
  24. package/dist/cli/build/patches/investigated/index.d.ts +4 -0
  25. package/dist/cli/build/patches/investigated/index.js +4 -0
  26. package/dist/cli/build/patches/investigated/patch-cache.d.ts +13 -0
  27. package/dist/cli/build/patches/investigated/patch-cache.js +22 -0
  28. package/dist/cli/build/patches/investigated/patch-require.d.ts +7 -0
  29. package/dist/cli/build/patches/investigated/patch-require.js +9 -0
  30. package/dist/cli/build/patches/investigated/update-webpack-chunks-file/get-chunk-installation-identifiers.d.ts +13 -0
  31. package/dist/cli/build/patches/investigated/update-webpack-chunks-file/get-chunk-installation-identifiers.js +82 -0
  32. package/dist/cli/build/patches/investigated/update-webpack-chunks-file/get-chunk-installation-identifiers.test.d.ts +1 -0
  33. package/dist/cli/build/patches/investigated/update-webpack-chunks-file/get-chunk-installation-identifiers.test.js +20 -0
  34. package/dist/cli/build/patches/investigated/update-webpack-chunks-file/get-file-content-with-updated-webpack-f-require-code.d.ts +19 -0
  35. package/dist/cli/build/patches/investigated/update-webpack-chunks-file/get-file-content-with-updated-webpack-f-require-code.js +76 -0
  36. package/dist/cli/build/patches/investigated/update-webpack-chunks-file/get-file-content-with-updated-webpack-f-require-code.test.d.ts +1 -0
  37. package/dist/cli/build/patches/investigated/update-webpack-chunks-file/get-file-content-with-updated-webpack-f-require-code.test.js +23 -0
  38. package/dist/cli/build/patches/investigated/update-webpack-chunks-file/get-updated-webpack-chunks-file-content.d.ts +14 -0
  39. package/dist/cli/build/patches/investigated/update-webpack-chunks-file/get-updated-webpack-chunks-file-content.js +22 -0
  40. package/dist/cli/build/patches/investigated/update-webpack-chunks-file/get-updated-webpack-chunks-file-content.test.d.ts +1 -0
  41. package/dist/cli/build/patches/investigated/update-webpack-chunks-file/get-updated-webpack-chunks-file-content.test.js +15 -0
  42. package/dist/cli/build/patches/investigated/update-webpack-chunks-file/index.d.ts +8 -0
  43. package/dist/cli/build/patches/investigated/update-webpack-chunks-file/index.js +22 -0
  44. package/dist/cli/build/patches/to-investigate/index.d.ts +8 -0
  45. package/dist/cli/build/patches/to-investigate/index.js +8 -0
  46. package/dist/cli/build/patches/to-investigate/inline-eval-manifest.d.ts +9 -0
  47. package/dist/cli/build/patches/to-investigate/inline-eval-manifest.js +32 -0
  48. package/dist/cli/build/patches/to-investigate/inline-middleware-manifest-require.d.ts +6 -0
  49. package/dist/cli/build/patches/to-investigate/inline-middleware-manifest-require.js +13 -0
  50. package/dist/cli/build/patches/to-investigate/inline-next-require.d.ts +6 -0
  51. package/dist/cli/build/patches/to-investigate/inline-next-require.js +36 -0
  52. package/dist/cli/build/patches/to-investigate/patch-exception-bubbling.d.ts +7 -0
  53. package/dist/cli/build/patches/to-investigate/patch-exception-bubbling.js +9 -0
  54. package/dist/cli/build/patches/to-investigate/patch-find-dir.d.ts +8 -0
  55. package/dist/cli/build/patches/to-investigate/patch-find-dir.js +21 -0
  56. package/dist/cli/build/patches/to-investigate/patch-load-instrumentation-module.d.ts +14 -0
  57. package/dist/cli/build/patches/to-investigate/patch-load-instrumentation-module.js +34 -0
  58. package/dist/cli/build/patches/to-investigate/patch-read-file.d.ts +3 -0
  59. package/dist/cli/build/patches/to-investigate/patch-read-file.js +29 -0
  60. package/dist/cli/build/patches/to-investigate/wrangler-deps.d.ts +2 -0
  61. package/dist/cli/build/patches/to-investigate/wrangler-deps.js +54 -0
  62. package/dist/cli/build/utils/extract-project-env-vars.d.ts +18 -0
  63. package/dist/cli/build/utils/extract-project-env-vars.js +32 -0
  64. package/dist/cli/build/utils/extract-project-env-vars.spec.d.ts +1 -0
  65. package/dist/cli/build/utils/extract-project-env-vars.spec.js +57 -0
  66. package/dist/cli/build/utils/index.d.ts +3 -0
  67. package/dist/cli/build/utils/index.js +3 -0
  68. package/dist/cli/build/utils/normalize-path.d.ts +1 -0
  69. package/dist/cli/build/utils/normalize-path.js +4 -0
  70. package/dist/cli/build/utils/read-paths-recursively.d.ts +7 -0
  71. package/dist/cli/build/utils/read-paths-recursively.js +20 -0
  72. package/dist/cli/build/utils/ts-parse-file.d.ts +8 -0
  73. package/dist/cli/build/utils/ts-parse-file.js +12 -0
  74. package/dist/cli/config.d.ts +41 -0
  75. package/dist/cli/config.js +92 -0
  76. package/dist/cli/index.d.ts +2 -0
  77. package/dist/cli/index.js +12 -0
  78. package/dist/cli/templates/shims/empty.d.ts +2 -0
  79. package/dist/cli/templates/shims/env.d.ts +1 -0
  80. package/dist/cli/templates/shims/env.js +1 -0
  81. package/dist/cli/templates/shims/node-fs.d.ts +17 -0
  82. package/dist/cli/templates/shims/node-fs.js +51 -0
  83. package/dist/cli/templates/shims/throw.d.ts +0 -0
  84. package/dist/cli/templates/shims/{throw.ts → throw.js} +1 -0
  85. package/dist/cli/templates/worker.d.ts +5 -0
  86. package/dist/cli/templates/worker.js +67 -0
  87. package/package.json +30 -14
  88. package/dist/api/chunk-VTBEIZPQ.mjs +0 -32
  89. package/dist/api/get-cloudflare-context.mjs +0 -6
  90. package/dist/api/index.d.mts +0 -1
  91. package/dist/api/index.mjs +0 -6
  92. package/dist/cli/constants/incremental-cache.ts +0 -8
  93. package/dist/cli/index.mjs +0 -7422
  94. package/dist/cli/templates/cache-handler/index.ts +0 -1
  95. package/dist/cli/templates/cache-handler/open-next-cache-handler.ts +0 -148
  96. package/dist/cli/templates/cache-handler/utils.ts +0 -41
  97. package/dist/cli/templates/shims/env.ts +0 -1
  98. package/dist/cli/templates/shims/node-fs.ts +0 -69
  99. package/dist/cli/templates/worker.ts +0 -156
  100. /package/dist/cli/templates/shims/{empty.ts → empty.js} +0 -0
@@ -1 +0,0 @@
1
- export * from "./open-next-cache-handler";
@@ -1,148 +0,0 @@
1
- import type {
2
- CacheHandler,
3
- CacheHandlerContext,
4
- CacheHandlerValue,
5
- } from "next/dist/server/lib/incremental-cache";
6
- import {
7
- NEXT_BODY_SUFFIX,
8
- NEXT_DATA_SUFFIX,
9
- NEXT_HTML_SUFFIX,
10
- RSC_PREFETCH_SUFFIX,
11
- RSC_SUFFIX,
12
- SEED_DATA_DIR,
13
- } from "../../constants/incremental-cache";
14
- import { getSeedBodyFile, getSeedMetaFile, getSeedTextFile, parseCtx } from "./utils";
15
- import type { IncrementalCacheValue } from "next/dist/server/response-cache";
16
- import type { KVNamespace } from "@cloudflare/workers-types";
17
-
18
- type CacheEntry = {
19
- lastModified: number;
20
- value: IncrementalCacheValue | null;
21
- };
22
-
23
- export class OpenNextCacheHandler implements CacheHandler {
24
- protected kv: KVNamespace | undefined;
25
-
26
- protected debug: boolean = !!process.env.NEXT_PRIVATE_DEBUG_CACHE;
27
-
28
- constructor(protected ctx: CacheHandlerContext) {
29
- this.kv = process.env[process.env.__OPENNEXT_KV_BINDING_NAME] as KVNamespace | undefined;
30
- }
31
-
32
- async get(...args: Parameters<CacheHandler["get"]>): Promise<CacheHandlerValue | null> {
33
- const [key, _ctx] = args;
34
- const ctx = parseCtx(_ctx);
35
-
36
- if (this.debug) console.log(`cache - get: ${key}, ${ctx?.kind}`);
37
-
38
- if (this.kv !== undefined) {
39
- try {
40
- const value = await this.kv.get<CacheEntry>(key, "json");
41
- if (value) return value;
42
- } catch (e) {
43
- console.error(`Failed to get value for key = ${key}: ${e}`);
44
- }
45
- }
46
-
47
- // Check for seed data from the file-system.
48
-
49
- // we don't check for seed data for fetch or image cache entries
50
- if (ctx?.kind === "FETCH" || ctx?.kind === "IMAGE") return null;
51
-
52
- const seedKey = `http://assets.local/${SEED_DATA_DIR}/${key}`.replace(/\/\//g, "/");
53
-
54
- if (ctx?.kind === "APP" || ctx?.kind === "APP_ROUTE") {
55
- const fallbackBody = await getSeedBodyFile(seedKey, NEXT_BODY_SUFFIX);
56
- if (fallbackBody) {
57
- const meta = await getSeedMetaFile(seedKey);
58
- return {
59
- lastModified: meta?.lastModified,
60
- value: {
61
- kind: (ctx.kind === "APP_ROUTE" ? ctx.kind : "ROUTE") as Extract<
62
- IncrementalCacheValue["kind"],
63
- "ROUTE"
64
- >,
65
- body: fallbackBody,
66
- status: meta?.status ?? 200,
67
- headers: meta?.headers ?? {},
68
- },
69
- };
70
- }
71
-
72
- if (ctx.kind === "APP_ROUTE") {
73
- return null;
74
- }
75
- }
76
-
77
- const seedHtml = await getSeedTextFile(seedKey, NEXT_HTML_SUFFIX);
78
- if (!seedHtml) return null; // we're only checking for prerendered routes at the moment
79
-
80
- if (ctx?.kind === "PAGES" || ctx?.kind === "APP" || ctx?.kind === "APP_PAGE") {
81
- const metaPromise = getSeedMetaFile(seedKey);
82
-
83
- let pageDataPromise: Promise<Buffer | string | undefined> = Promise.resolve(undefined);
84
- if (!ctx.isFallback) {
85
- const rscSuffix = ctx.isRoutePPREnabled ? RSC_PREFETCH_SUFFIX : RSC_SUFFIX;
86
-
87
- if (ctx.kind === "APP_PAGE") {
88
- pageDataPromise = getSeedBodyFile(seedKey, rscSuffix);
89
- } else {
90
- pageDataPromise = getSeedTextFile(seedKey, ctx.kind === "APP" ? rscSuffix : NEXT_DATA_SUFFIX);
91
- }
92
- }
93
-
94
- const [meta, pageData] = await Promise.all([metaPromise, pageDataPromise]);
95
-
96
- return {
97
- lastModified: meta?.lastModified,
98
- value: {
99
- kind: (ctx.kind === "APP_PAGE" ? "APP_PAGE" : "PAGE") as Extract<
100
- IncrementalCacheValue["kind"],
101
- "PAGE"
102
- >,
103
- html: seedHtml,
104
- pageData: pageData ?? "",
105
- ...(ctx.kind === "APP_PAGE" && { rscData: pageData }),
106
- postponed: meta?.postponed,
107
- status: meta?.status,
108
- headers: meta?.headers,
109
- },
110
- };
111
- }
112
-
113
- return null;
114
- }
115
-
116
- async set(...args: Parameters<CacheHandler["set"]>) {
117
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
118
- const [key, entry, _ctx] = args;
119
-
120
- if (this.kv === undefined) {
121
- return;
122
- }
123
-
124
- if (this.debug) console.log(`cache - set: ${key}`);
125
-
126
- const data: CacheEntry = {
127
- lastModified: Date.now(),
128
- value: entry,
129
- };
130
-
131
- try {
132
- await this.kv.put(key, JSON.stringify(data));
133
- } catch (e) {
134
- console.error(`Failed to set value for key = ${key}: ${e}`);
135
- }
136
- }
137
-
138
- async revalidateTag(...args: Parameters<CacheHandler["revalidateTag"]>) {
139
- const [tags] = args;
140
- if (this.kv === undefined) {
141
- return;
142
- }
143
-
144
- if (this.debug) console.log(`cache - revalidateTag: ${JSON.stringify([tags].flat())}`);
145
- }
146
-
147
- resetRequestCache(): void {}
148
- }
@@ -1,41 +0,0 @@
1
- import type { IncrementalCache } from "next/dist/server/lib/incremental-cache";
2
- import { NEXT_META_SUFFIX } from "../../constants/incremental-cache";
3
-
4
- type PrerenderedRouteMeta = {
5
- lastModified: number;
6
- status?: number;
7
- headers?: Record<string, string>;
8
- postponed?: string;
9
- };
10
-
11
- type EntryKind =
12
- | "APP" // .body, .html - backwards compat
13
- | "PAGES"
14
- | "FETCH"
15
- | "APP_ROUTE" // .body
16
- | "APP_PAGE" // .html
17
- | "IMAGE"
18
- | undefined;
19
-
20
- async function getAsset<T>(key: string, cb: (resp: Response) => T): Promise<Awaited<T> | undefined> {
21
- const resp = await process.env.ASSETS.fetch(key);
22
- return resp.status === 200 ? await cb(resp) : undefined;
23
- }
24
-
25
- export function getSeedBodyFile(key: string, suffix: string) {
26
- return getAsset(key + suffix, (resp) => resp.arrayBuffer() as Promise<Buffer>);
27
- }
28
-
29
- export function getSeedTextFile(key: string, suffix: string) {
30
- return getAsset(key + suffix, (resp) => resp.text());
31
- }
32
-
33
- export function getSeedMetaFile(key: string) {
34
- return getAsset(key + NEXT_META_SUFFIX, (resp) => resp.json<PrerenderedRouteMeta>());
35
- }
36
-
37
- export function parseCtx(ctx: Parameters<IncrementalCache["get"]>[1] = {}) {
38
- return { ...ctx, kind: ctx?.kindHint?.toUpperCase() } as
39
- | (typeof ctx & { kind?: EntryKind; isFallback?: boolean; isRoutePPREnabled?: boolean })
40
- | undefined;
41
- }
@@ -1 +0,0 @@
1
- export function loadEnvConfig() {}
@@ -1,69 +0,0 @@
1
- // https://github.com/vercel/next.js/blob/canary/packages/next/src/server/lib/node-fs-methods.ts
2
-
3
- export const nodeFs = {
4
- existsSync,
5
- readFile,
6
- readFileSync,
7
- writeFile,
8
- mkdir,
9
- stat,
10
- };
11
-
12
- const FILES = new Map<string, unknown>();
13
- const MTIME = Date.now();
14
-
15
- function existsSync(path: string) {
16
- console.log("existsSync", path, new Error().stack?.split("\n").slice(1).join("\n"));
17
- return FILES.has(path);
18
- }
19
-
20
- async function readFile(path: string, options: unknown): Promise<unknown> {
21
- console.log(
22
- "readFile",
23
- { path, options }
24
- // new Error().stack.split("\n").slice(1).join("\n"),
25
- );
26
- if (!FILES.has(path)) {
27
- throw new Error(path + "does not exist");
28
- }
29
- return FILES.get(path);
30
- }
31
-
32
- function readFileSync(path: string, options: unknown) {
33
- console.log(
34
- "readFileSync",
35
- { path, options }
36
- // new Error().stack.split("\n").slice(1).join("\n"),
37
- );
38
- if (!FILES.has(path)) {
39
- throw new Error(path + "does not exist");
40
- }
41
- return FILES.get(path);
42
- }
43
-
44
- async function writeFile(file: string, data: unknown) {
45
- console.log(
46
- "writeFile",
47
- { file, data }
48
- // new Error().stack.split("\n").slice(1).join("\n"),
49
- );
50
- FILES.set(file, data);
51
- return true;
52
- }
53
-
54
- async function mkdir(dir: string) {
55
- console.log(
56
- "mkdir",
57
- dir
58
- //new Error().stack.split("\n").slice(1).join("\n"),
59
- );
60
- }
61
-
62
- async function stat(file: string) {
63
- console.log(
64
- "stat",
65
- file
66
- // new Error().stack.split("\n").slice(1).join("\n"),
67
- );
68
- return { mtime: new Date(MTIME) };
69
- }
@@ -1,156 +0,0 @@
1
- import type { ExportedHandler, Fetcher } from "@cloudflare/workers-types";
2
- import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node";
3
- import { AsyncLocalStorage } from "node:async_hooks";
4
- import type { CloudflareContext } from "../../api";
5
- import type { IncomingMessage } from "node:http";
6
- import { MockedResponse } from "next/dist/server/lib/mock-request";
7
- import type { NextConfig } from "next";
8
- import type { NodeRequestHandler } from "next/dist/server/next-server";
9
- import Stream from "node:stream";
10
-
11
- const NON_BODY_RESPONSES = new Set([101, 204, 205, 304]);
12
-
13
- const cloudflareContextALS = new AsyncLocalStorage<CloudflareContext>();
14
-
15
- // Note: this symbol needs to be kept in sync with the one defined in `src/api/get-cloudflare-context.ts`
16
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
- (globalThis as any)[Symbol.for("__cloudflare-context__")] = new Proxy(
18
- {},
19
- {
20
- ownKeys: () => Reflect.ownKeys(cloudflareContextALS.getStore()!),
21
- getOwnPropertyDescriptor: (_, ...args) =>
22
- Reflect.getOwnPropertyDescriptor(cloudflareContextALS.getStore()!, ...args),
23
- get: (_, property) => Reflect.get(cloudflareContextALS.getStore()!, property),
24
- set: (_, property, value) => Reflect.set(cloudflareContextALS.getStore()!, property, value),
25
- }
26
- );
27
-
28
- // Injected at build time
29
- const nextConfig: NextConfig = JSON.parse(process.env.__NEXT_PRIVATE_STANDALONE_CONFIG ?? "{}");
30
-
31
- let requestHandler: NodeRequestHandler | null = null;
32
-
33
- export default {
34
- async fetch(request, env, ctx) {
35
- return cloudflareContextALS.run({ env, ctx, cf: request.cf }, async () => {
36
- if (requestHandler == null) {
37
- globalThis.process.env = { ...globalThis.process.env, ...env };
38
- // Note: "next/dist/server/next-server" is a cjs module so we have to `require` it not to confuse esbuild
39
- // (since esbuild can run in projects with different module resolutions)
40
- // eslint-disable-next-line @typescript-eslint/no-require-imports
41
- const NextNodeServer = require("next/dist/server/next-server")
42
- .default as typeof import("next/dist/server/next-server").default;
43
-
44
- requestHandler = new NextNodeServer({
45
- conf: nextConfig,
46
- customServer: false,
47
- dev: false,
48
- dir: "",
49
- minimalMode: false,
50
- }).getRequestHandler();
51
- }
52
-
53
- const url = new URL(request.url);
54
-
55
- if (url.pathname === "/_next/image") {
56
- const imageUrl =
57
- url.searchParams.get("url") ?? "https://developers.cloudflare.com/_astro/logo.BU9hiExz.svg";
58
- if (imageUrl.startsWith("/")) {
59
- return env.ASSETS.fetch(new URL(imageUrl, request.url));
60
- }
61
- return fetch(imageUrl, { cf: { cacheEverything: true } });
62
- }
63
-
64
- const { req, res, webResponse } = getWrappedStreams(request, ctx);
65
-
66
- ctx.waitUntil(Promise.resolve(requestHandler(new NodeNextRequest(req), new NodeNextResponse(res))));
67
-
68
- return await webResponse();
69
- });
70
- },
71
- } as ExportedHandler<{ ASSETS: Fetcher }>;
72
-
73
- function getWrappedStreams(request: Request, ctx: ExecutionContext) {
74
- const url = new URL(request.url);
75
-
76
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
77
- const reqBody = request.body && Stream.Readable.fromWeb(request.body as any);
78
- const req = (reqBody ?? Stream.Readable.from([])) as IncomingMessage;
79
- req.httpVersion = "1.0";
80
- req.httpVersionMajor = 1;
81
- req.httpVersionMinor = 0;
82
- req.url = url.href.slice(url.origin.length);
83
- req.headers = Object.fromEntries([...request.headers]);
84
- req.method = request.method;
85
- Object.defineProperty(req, "__node_stream__", {
86
- value: true,
87
- writable: false,
88
- });
89
- Object.defineProperty(req, "headersDistinct", {
90
- get() {
91
- const headers: Record<string, string[]> = {};
92
- for (const [key, value] of Object.entries(req.headers)) {
93
- if (!value) continue;
94
- headers[key] = Array.isArray(value) ? value : [value];
95
- }
96
- return headers;
97
- },
98
- });
99
-
100
- const { readable, writable } = new IdentityTransformStream();
101
- const resBodyWriter = writable.getWriter();
102
-
103
- const res = new MockedResponse({
104
- resWriter: (chunk) => {
105
- resBodyWriter.write(typeof chunk === "string" ? Buffer.from(chunk) : chunk).catch((err) => {
106
- if (
107
- err.message.includes("WritableStream has been closed") ||
108
- err.message.includes("Network connection lost")
109
- ) {
110
- // safe to ignore
111
- return;
112
- }
113
- console.error("Error in resBodyWriter.write");
114
- console.error(err);
115
- });
116
- return true;
117
- },
118
- });
119
-
120
- // It's implemented as a no-op, but really it should mark the headers as done
121
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
122
- res.flushHeaders = () => (res as any).headPromiseResolve();
123
-
124
- // Only allow statusCode to be modified if not sent
125
- let { statusCode } = res;
126
- Object.defineProperty(res, "statusCode", {
127
- get: function () {
128
- return statusCode;
129
- },
130
- set: function (val) {
131
- if (this.finished || this.headersSent) {
132
- return;
133
- }
134
- statusCode = val;
135
- },
136
- });
137
-
138
- // Make sure the writer is eventually closed
139
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
140
- ctx.waitUntil((res as any).hasStreamed.finally(() => resBodyWriter.close().catch(() => {})));
141
-
142
- return {
143
- res,
144
- req,
145
- webResponse: async () => {
146
- await res.headPromise;
147
- // TODO: remove this once streaming with compression is working nicely
148
- res.setHeader("content-encoding", "identity");
149
- return new Response(NON_BODY_RESPONSES.has(res.statusCode) ? null : readable, {
150
- status: res.statusCode,
151
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
152
- headers: (res as any).headers,
153
- });
154
- },
155
- };
156
- }
File without changes