Skip to content

Commit 773239c

Browse files
committed
test(e2e): stop requiring Content-Length on streamed Route Handler downloads
Next.js 16.4.5 strips Content-Length and Content-Encoding from every Route Handler response (GHSA-pc58-hwjq-p385); upstream kept that in 16.4.6 and closed the scoped alternative, so a large download now arrives chunked without a declared length. The history suite still proves incremental delivery, the full byte count and the content hash, and checks a declared length whenever one is present.
1 parent 12ca9d6 commit 773239c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎apps/sim/scripts/test-project-file-history-e2e.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ async function verifyStreamedDownload(
6969
signal: AbortSignal.timeout(90_000),
7070
})
7171
assert.equal(response.status, 200)
72-
assert.equal(Number(response.headers.get('content-length')), expectedBytes)
72+
// Next 16.4.5+ strips Content-Length from every Route Handler response (GHSA-pc58-hwjq-p385).
73+
const declaredLength = response.headers.get('content-length')
74+
if (declaredLength !== null) assert.equal(Number(declaredLength), expectedBytes)
7375
assert.ok(response.body)
7476
const reader = response.body.getReader()
7577
const hash = createHash('sha256')

0 commit comments

Comments
 (0)