fix: unify body and query serialisation behaviour#1808
Merged
titanism merged 2 commits intoforwardemail:masterfrom Aug 24, 2024
mao-sz:fix/unify-body-query-serialisation-behaviour
Merged
fix: unify body and query serialisation behaviour#1808titanism merged 2 commits intoforwardemail:masterfrom mao-sz:fix/unify-body-query-serialisation-behaviour
titanism merged 2 commits intoforwardemail:masterfrom
mao-sz:fix/unify-body-query-serialisation-behaviour
Conversation
…tion Body serialisation now also matches documentation.
Contributor
Author
|
@titanism anything extra I might need to fix the above? |
Collaborator
|
v10.1.0 released to npm, thank you @MaoShizhong ref: https://github.com/ladjs/superagent/releases/tag/v10.1.0 p.s. our efforts to maintain this repo are supported by @forwardemail |
Collaborator
|
@MaoShizhong your work appears to have broken the project qs serialization, see forwardemail/supertest#863 (comment). can you chime in here to discuss a solution, otherwise I may revert this commit |
Contributor
Author
|
Will have a look shortly, thanks for letting me know |
Contributor
Author
|
Will reply in the linked issue |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because
#1591 changed things to use
qsto serialise form data. However, that change setqs.stringifyas the body serialisation function i.e. default options. The existing query serialisation usesqs.stringifywithindices: falseandstrictNullHandling: trueoptions (src/node/index.jsline 679).Existing documentation indicates that body serialisation with duplicated object keys should result in the same behaviour as the existing query serialisation. However,
qs.stringifywith default options results in a different outcome, as described in the issue this PR closes.This PR
Linked issue
Closes #1798
Checklist