Skip to content

Commit 3243c36

Browse files
committed
fix(next): apply the framing rule to the prebundled production server runtime
1 parent ecf6798 commit 3243c36

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

‎patches/README.md‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,20 +150,22 @@ sent. Dropping the headers from every response also strips the declared length
150150
from file downloads, which then arrive chunked with no size, and the
151151
`Content-Encoding: none` marker that keeps streaming responses uncompressed.
152152

153-
The same file's patch narrows that rule in `sendResponse`, in both the CommonJS
154-
and ESM builds. A response whose `Content-Encoding` names a real coding keeps
153+
The same file's patch narrows that rule in `sendResponse`: the CommonJS and ESM
154+
module builds, and the copy prebundled into
155+
`compiled/next-server/server.runtime.prod.js`, which `next start` runs. A response whose `Content-Encoding` names a real coding keeps
155156
upstream's behavior: its length and coding are dropped. A response with no coding,
156157
or with `identity`/`none`, was not decoded, so its `Content-Length` and coding are
157158
forwarded. `Transfer-Encoding` is never forwarded; Node frames the response
158159
itself. Route handlers, App Page rendering, and the edge runtime are otherwise
159160
unchanged.
160161

161-
`test:headers:e2e` sends real responses through both builds of `sendResponse`
162-
over loopback HTTP. The unencoded, `identity`, and `none` checks fail against
162+
`test:headers:e2e` sends real responses through both module builds of
163+
`sendResponse` over loopback HTTP. The unencoded, `identity`, and `none` checks fail against
163164
unpatched 16.4.5. The decoded-body and transfer-coding checks fail when their
164165
guards are removed; forwarding a decoded body's stale length leaves the client
165166
unable to parse the connection. The project-files E2E's large-download check
166-
asserts the declared length of a 100 MB file served through the running app.
167+
covers the production runtime: it asserts the declared length of a 100 MB file
168+
served by the built app.
167169

168170
Remove this part of the patch when upstream forwards framing for undecoded
169171
route-handler bodies, and keep both regression checks.

0 commit comments

Comments
 (0)