mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #30] [MERGED] Fix binary response handling in Pages Router prod server #253
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#253
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/30
Author: @linares222
Created: 2/24/2026
Status: ✅ Merged
Merged: 2/25/2026
Merged by: @southpolesteve
Base:
main← Head:fix-binary-response-handling📝 Commits (1)
9e133bafix: preserve binary API response bytes in prod-server📊 Changes
3 files changed (+22 additions, -2 deletions)
View changed files
📝
packages/vinext/src/server/prod-server.ts(+2 -2)➕
tests/fixtures/pages-basic/pages/api/binary.ts(+9 -0)📝
tests/pages-router.test.ts(+11 -0)📄 Description
Fixes a Pages Router prod-server response handling bug where
response.text()could corrupt binary payloads.Changes
response.text()toBuffer.from(await response.arrayBuffer())/api/binaryfixture route returning known bytes/api/binaryWhy
API routes can return raw bytes (
res.end(Buffer)). Decoding as text before writing can mangle non-UTF8 bytes.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.