Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(httpParamSerializerJQLike): Follow jQuery for null and undefined #15971

Closed
wants to merge 1 commit into from

Conversation

lgalfaso
Copy link
Contributor

@lgalfaso lgalfaso commented May 7, 2017

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Follow jQuery when serializing null and undefined.

What is the current behavior? (You can also link to an open issue here)

$httpParamSerializerJQLike({items:['foo', 'bar', null, undefined]}) ==
  'items%5B%5D=foo&items%5B%5D=bar';

What is the new behavior (if this is a feature change)?

$httpParamSerializerJQLike({items:['foo', 'bar', null, undefined]}) ==
  'items%5B%5D=foo&items%5B%5D=bar&items%5B%5D=&items%5B%5D=';

Does this PR introduce a breaking change?
Yes, but does so to follow the implementation in jQuery.

Please check if the PR fulfills these requirements

Other information:

Closes: #15969

Follow jQuery when serializing `null` and `undefined`.

Closes: angular#15969
Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

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

LGTM, but I lean towards not backporting to 1.6. due to the breaking change (even if only to follow jQuery).

@lgalfaso lgalfaso closed this in 301fdda May 7, 2017
@lgalfaso
Copy link
Contributor Author

lgalfaso commented May 7, 2017

Merged into master as 301fdda
Agree in not back porting this into 1.6.x

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Null array items should be omit by $httpParamSerializer
3 participants