Skip to content

[codex] fix binary request bodies#112

Draft
maxvaljan wants to merge 1 commit into
margelo:mainfrom
maxvaljan:codex/fix-binary-request-bodies
Draft

[codex] fix binary request bodies#112
maxvaljan wants to merge 1 commit into
margelo:mainfrom
maxvaljan:codex/fix-binary-request-bodies

Conversation

@maxvaljan

Copy link
Copy Markdown

Summary

  • change NitroRequest.bodyBytes to ArrayBuffer and regenerate Nitrogen bindings
  • pass normalized ArrayBuffer/typed-array request bodies through to native instead of dropping them
  • write binary upload bytes into URLSession/Cronet request bodies
  • add a JS regression test for ArrayBuffer and typed-array request bodies

Root Cause

The public fetch API and docs support ArrayBuffer and typed-array request bodies, but buildNitroRequest and buildNitroRequestPure set bodyBytes to undefined. The native request paths also could not upload binary bodies: iOS ignored req.bodyBytes, and Android sent a one-byte placeholder.

Notes

Cold-start prefetch entries are JSON-backed, so this PR does not try to persist raw binary prefetch bodies through bodyBytes. String and form-data prefetch behavior remains unchanged.

Validation

  • bun --cwd packages/react-native-nitro-fetch test -- src/__tests__/fetch.test.ts src/__tests__/Response.test.ts
  • bun --cwd packages/react-native-nitro-fetch typecheck
  • bun --cwd packages/react-native-nitro-fetch nitrogen
  • commit hook: staged lint + types + commitlint passed

Package-wide bun --cwd packages/react-native-nitro-fetch lint still reports existing tracked .js formatting/no-undef issues outside this diff.

@vercel

vercel Bot commented Jun 6, 2026

Copy link
Copy Markdown

@maxvaljan is attempting to deploy a commit to the Margelo Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant