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

[8.x] Fix option overrides #41392

Closed
wants to merge 3 commits into from
Closed

[8.x] Fix option overrides #41392

wants to merge 3 commits into from

Conversation

driesvints
Copy link
Member

This PR fixes an issue with option overriding introduced in #40954. The problem is that by default a value of 'options' => null gets added when the default value of a HTTP call (get, post,...) is left empty. Because array_merge_recursive was changed to array_replace_recursive, the default value removed the value of query set with withOptions.

The way I fixed it is to filter out any null value of options before sending the request. It doesn't seems you want to add null values to a request? However, if users are explicitly removing options set with withOptions by assigning null values, this will no longer work. But all tests pass right now and the docs don't note anything about that behavior so I don't think that's expected.

Related: #40954 & 30e341b

Fixes #41382

@taylorotwell
Copy link
Member

Fixed a54f481

1 similar comment
@taylorotwell
Copy link
Member

Fixed a54f481

@taylorotwell taylorotwell deleted the fix-http-options branch March 8, 2022 16:08
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

Successfully merging this pull request may close these issues.

HTTP Client query parameters not merged as expected after upgrading
3 participants