Skip to content

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

@Willshaw

Description

@Willshaw

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    status::add-to-docsContains content that needs to be included in our docs

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions