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

null parameters are getting passed in urls breaking requests in v0.x #6393

Open
Willshaw opened this issue May 15, 2024 · 0 comments
Open

null parameters are getting passed in urls breaking requests in v0.x #6393

Willshaw opened this issue May 15, 2024 · 0 comments

Comments

@Willshaw
Copy link

Willshaw commented May 15, 2024

This PR to backport custom params serializer from v1 into v0: #6263

does not include the v1 fix outlined below (spotted by @FlorisVeldhuizen) around null params being pushed into the URL.

It looks like the changes to toFormData.js were not included in the backport: b0ebf9f#diff-8423b44acd3fb9f35b00404bfeed15aaf4659cdf06b879849c5026b4a05d2efa

axios v0.28.1 will send blank params:

{
  foo: null,
  bar: 1
}

?foo&bar=1

axios v0.27 does not send blank params

{
  foo: null,
  bar: 1
}

?bar=1

It seems that null and undefined parameters are now getting passed as well in urls, breaking many requests. You can see this check being removed in #4734, I wonder how this breaking change that is not mentioned anywhere went under the radar

Good catch; I wonder if we can update the main meat of their toString function for serializing the params to omit undefined and null. Feel free to make suggestions on #5108! I just wanted some of the old functionality back 😅

Originally posted by @ChronosMasterOfAllTime in #5107 (comment)

@Willshaw Willshaw changed the title null parameters are getting passed in urls breaking requests null parameters are getting passed in urls breaking requests in v0.x May 15, 2024
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

No branches or pull requests

1 participant