Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bun compatibility #439

Open
1 task
chriscdn opened this issue Sep 3, 2024 · 0 comments
Open
1 task

Bun compatibility #439

chriscdn opened this issue Sep 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@chriscdn
Copy link

chriscdn commented Sep 3, 2024

Describe the feature

I tried ofetch with Bun. It seems to work, but I ran into a small issue when POSTing multipart/form-data. It seems the Bun FormData class has a toJSON method, while Node and Deno do not. It causes the isJSONSerializable() method to return true (exact line below), and therefore sends the serialized payload as application/json instead of multipart/form-data.

Would a value instanceof FormData check make sense here?

typeof value.toJSON === "function"

Additional information

  • Would you be willing to help implement this feature?
@chriscdn chriscdn added the enhancement New feature or request label Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant