Skip to content

Handle native FormData in edge runtimes - #698

Open
alloutflo wants to merge 1 commit into
HubSpot:masterfrom
alloutflo:codex/issue-696-formdata-headers
Open

Handle native FormData in edge runtimes#698
alloutflo wants to merge 1 commit into
HubSpot:masterfrom
alloutflo:codex/issue-696-formdata-headers

Conversation

@alloutflo

Copy link
Copy Markdown

Summary

  • identify npm form-data bodies by their stream and getHeaders() capabilities instead of constructor identity
  • keep npm form-data uploads on the Node transport while allowing WHATWG FormData to use native fetch
  • add an edge-runtime regression that reproduces the reported body.getHeaders is not a function failure with a shimmed FormData constructor

Fixes #696.

Testing

  • full Jasmine suite: 85 specs passed
  • existing npm form-data multipart request test passed
  • new WHATWG FormData runtime-shim request test passed
  • npm run lint
  • npm run build

AI assistance disclosure

OpenAI Codex was used to analyze, implement, and test this change. The diff and checks listed above were verified in the contribution workspace.

@alloutflo

Copy link
Copy Markdown
Author

@ksvirkou-hubspot Maintainer handoff: this PR is ready for review, mergeable, up to date with master, and has no review comments or open threads. The repository’s lint and test workflows are push-only, so GitHub does not create an upstream PR check here. The full local Jasmine suite passes (85 specs), including both the existing npm form-data path and the new WHATWG FormData edge-runtime regression; lint and build also pass. Could you review the transport capability check when convenient?

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.

[v24.0.x] CRM create Import API throws "body.getHeaders is not a function" error

1 participant