Skip to content

Conversation

danilopolani
Copy link
Contributor

The PR fixes a weird behaviour where calling multiple times a method that sets a content type (or manually) will append the same content type duplicated, eventually causing issues with external APIs (especially with Express middlewares etc.).

Sample to reproduce the old behaviour:

use Illuminate\Support\Facades\Http; $client = Illuminate\Support\Facades\Http::asJson(); $client->asJson(); $client->asJson(); dd($client->getOptions()['headers']['Content-Type']);

Output

image

@taylorotwell taylorotwell merged commit 490713a into laravel:9.x Feb 4, 2023
@danilopolani danilopolani deleted the fix/http-client-duplicated-content-type branch February 4, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants