Skip to content

Fix native FormData uploads in Node - #9

Merged
githubsaturn merged 1 commit into
masterfrom
fix/native-form-data
Sep 20, 2026
Merged

githubsaturn merged 1 commit into
masterfrom
fix/native-form-data

Conversation

@githubsaturn

Copy link
Copy Markdown
Contributor

Node's native FormData is currently passed to cross-fetch's node-fetch v2 transport, which sends the literal text [object FormData] with text/plain content type. This prevents uploadAppData from delivering the sourceFile archive.

Pair native FormData with the runtime's native fetch encoder. Keep the existing cross-fetch path for JSON and other form-data implementations. Authentication and response/error handling are unchanged.

Adds a local HTTP-server regression test verifying multipart content type, sourceFile name, filename, authentication header, attached endpoint, and exact binary payload bytes.

Validation: reproduced the text/plain failure with published caprover-api 0.0.21; npm test passed all 11 tests after the fix, including build/lint and the real transport regression. Formatting and diff checks passed.

Prerequisite for the caprover-e2e source-upload suite (plan PR6). Publish a version containing this fix and update that suite's dependency before merging/running it. This PR does not publish a package.

@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 7fc8f39a-f34f-47c7-b722-e7efcb486410

📥 Commits

Reviewing files that changed from the base of the PR and between f7bfecc and 4ff4b94.

📒 Files selected for processing (2)
  • src/api/HttpClient.ts
  • test/NativeFormData.test.js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@githubsaturn
githubsaturn merged commit 067336c into master Sep 20, 2026
1 check passed
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