Description
Symfony version(s) affected
7.2
Description
This probably affects more than just symfony 7.2 version
When debugging my http requests I realized that headers configured in scoped clients were not shown in the profiler, even though those informations were used. This was also occuring with options given directly to the client.
Only options that were written directly in the resquest configuration are displayed, I believe this is either a bug or could be improved because that made debugging my requests a lot harder than it should have actually
The Copy as cURL button however does take headers coming from the scope configuration into account.
The Copy as cURL button does not copy passphrase/certificate informations no matter how it's configured, but I'm not sure if it's a bug on it's own or if intended like that.
How to reproduce
Create a scoped client
framework:
http_client:
scoped_clients:
test.client:
base_uri: '%env(API_URL)%'
headers:
CUSTOM-HEADER: foo
Configure client with options programatically
$this->testClient = $this->testClient->withOptions($options);
Options are taken into account but are not being displayed in the symfony profiler
This works well if options are being passed directly in the request configuration like that
$response = $this->testClient->request('GET', 'ping', [
'headers' => [
'CUSTOM-HEADER' => 'foo'
],
// ...other options
]);
Possible Solution
Profiler should display every piece of a request configuration, wether it's coming from the yaml configuration, from the client directly and not just the direct request configuration
Those options could be marked as herited to distinguish them
Additional Context
No response