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

[7.x] Avoid using array_merge_recursive in HTTP client #31858

Merged
merged 1 commit into from
Mar 9, 2020

Conversation

themsaid
Copy link
Member

@themsaid themsaid commented Mar 9, 2020

Using array_merge_recursive can lead to some configuration methods to set values to an array if called multiple times.

For example:

$client = Http::withToken('Token-A')->post();

// Do something which requires the original token

$client->withToken('Token-B')->post();

// Do something else that requires a different token.

Calling withToken multiple times will lead to having the token header value as an array.

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.

3 participants