Title: fix(next): keep route-handler framing for bodies Next did not decode by waleedlatif1 · Pull Request #9820 · simstudioai/sim · GitHub
Open Graph Title: fix(next): keep route-handler framing for bodies Next did not decode by waleedlatif1 · Pull Request #9820 · simstudioai/sim
X Title: fix(next): keep route-handler framing for bodies Next did not decode by waleedlatif1 · Pull Request #9820 · simstudioai/sim
Description: Summary Next.js 16.4.5 (taken in #9819 for GHSA-pc58-hwjq-p385 and six other advisories) drops Content-Length, Content-Encoding, and Transfer-Encoding from every Node route-handler response. Upstream's target is a fetched response returned unchanged: fetch decodes the body but keeps the original coding and length, so forwarding them misframes the body Dropping them from every response also strips the declared length from file downloads, so a 100 MB download arrives chunked with no size. The project-files E2E large-download check fails on staging for this reason. The Chat SSE route's Content-Encoding: none no-compression marker is dropped too Narrowed the rule in our existing next@16.4.5 patch: the CommonJS and ESM sendResponse builds and the copy prebundled into compiled/next-server/server.runtime.prod.js: A response whose Content-Encoding names a real coding keeps upstream's behavior; its length and coding are dropped A response with no coding, or with identity/none, was not decoded, so its Content-Length and coding are forwarded Transfer-Encoding is never forwarded Documented the patch in patches/README.md turbo.json now hashes patches/** into every task (globalDependencies). bun.lock records only a patch's path, so editing a patch left the app build hash unchanged and CI replayed a cached build of unpatched Next; the first CI run of this PR did exactly that. With the change, editing the patch changes the @sim/app#build hash, and restoring the file restores it Type of Change Bug fix Testing test:headers:e2e sends real responses through both builds of sendResponse over loopback HTTP; 26/26 pass The unencoded, identity, and none checks fail against unpatched 16.4.5 The decoded-body and transfer-coding checks fail when their guards are removed; forwarding a decoded body's stale length leaves the client unable to parse the connection Reinstalled next from the committed patch file and reran the suite turbo run build --dry=json: the @sim/app#build hash was unchanged by a patch edit before the turbo.json change and changes with it The project-files E2E (100 MB download through the running app, asserting its declared length) runs in CI and currently fails on staging Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing (new tests pass the test-audit authoring gate) No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary Next.js 16.4.5 (taken in #9819 for GHSA-pc58-hwjq-p385 and six other advisories) drops Content-Length, Content-Encoding, and Transfer-Encoding from every Node route-handler response. Upstr...
X Description: Summary Next.js 16.4.5 (taken in #9819 for GHSA-pc58-hwjq-p385 and six other advisories) drops Content-Length, Content-Encoding, and Transfer-Encoding from every Node route-handler response. Upstr...
Opengraph URL: https://github.com/simstudioai/sim/pull/9820
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:bb0b246d-e54b-9c05-2095-6ea25689ab2c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9C76:1B6493:1AB5C8:24DB74:6AFB2F7A |
| html-safe-nonce | 280a69b47fb4c89b7cc6ccd16acf214192546766230dd76d8192b981701357e3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Qzc2OjFCNjQ5MzoxQUI1Qzg6MjREQjc0OjZBRkIyRjdBIiwidmlzaXRvcl9pZCI6IjU3MzE3NTIxMTQ5MTAxMjQ3NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 41b6442289d61bdac41633b2849ebf1c7783ee4f7629461305272c676f3eab4f |
| hovercard-subject-tag | pull_request:5232435197 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/9820/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Next.js 16.4.5 (taken in #9819 for GHSA-pc58-hwjq-p385 and six other advisories) drops Content-Length, Content-Encoding, and Transfer-Encoding from every Node route-handler response. Upstr... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | efe184de15c1d8c1107a340cfc27bf7187b458dc07687ee1fa51f035148fb3d1 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f567cf3af46b50a3211fb5dab569a9d6a7b58025 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width