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

Fix: stringify objects when appending them to FormData #2748

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

Telroshan
Copy link
Collaborator

Description

Current implementation of FormData proxy fails to encode objects, which are appended as a poorly-stringified version, aka '[object Object]' (the toString equivalent).
This PR fixes this by calling JSON.stringify on such objects

Corresponding issue: #2616

Testing

  • Current situation can be tested on this JSFiddle, notice how the foo param is incorrectly formatted
  • Fix with this PR can be tested on this JSFiddle, notice how the foo param is now correctly formatted

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for
    source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly
    approved via an issue
  • I ran the test suite locally (npm run test) and verified that it succeeded

@Telroshan Telroshan added bug Something isn't working 2.0 ready for review Issues that are ready to be considered for merging labels Jul 21, 2024
Copy link
Collaborator

@alexpetros alexpetros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@alexpetros alexpetros merged commit 81b401a into bigskysoftware:dev Jul 26, 2024
1 check passed
@Telroshan Telroshan deleted the fix-form-data-json-value branch July 26, 2024 11:07
@Telroshan Telroshan mentioned this pull request Jul 31, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 bug Something isn't working ready for review Issues that are ready to be considered for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants