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

[SCOPED CLIENTS][HEADERS] Overwritten or merged? #20569

Open
GrinWay opened this issue Jan 14, 2025 · 6 comments
Open

[SCOPED CLIENTS][HEADERS] Overwritten or merged? #20569

GrinWay opened this issue Jan 14, 2025 · 6 comments

Comments

@GrinWay
Copy link

GrinWay commented Jan 14, 2025

That is an incomprihensible moment in the documentation about headers from scoped_clients config and manually written headers. If I have some headers from scoped client config and when I use HttpClient service and call "request" and then put there some headers... I'm not sure what will be... either headers from scoped_clients will be overwritten by my manually passed ones or they will be merged with headers from the config.

@GrinWay GrinWay changed the title [SCOPED CLIENTS][HEADERS] Overwrited or merged? [SCOPED CLIENTS][HEADERS] Overwriten or merged? Jan 14, 2025
@GrinWay GrinWay changed the title [SCOPED CLIENTS][HEADERS] Overwriten or merged? [SCOPED CLIENTS][HEADERS] Overwritten or merged? Jan 14, 2025
@OskarStark
Copy link
Contributor

Maybe you can try with a test command or so?
We should definitely document this 👍

@GrinWay
Copy link
Author

GrinWay commented Jan 15, 2025

I heard you, thanks
But that's rather hard or not possible at all to test not WebTestCase http_client REQUEST headers, cuz profiler service doesn't see any request made with a usual service http_client ( not static::createClient() ).

For profiling reasons as we all know people use WebTestCase http_client, where we can enableProfiler

But I don't wanna use WebTestCase http_client ( with static::createClient() ), cuz this client is not configurable with framework.http_client.scoped_clients configuration.

@OskarStark
Copy link
Contributor

Maybe I don't get it fully, but you can create a Symfony command inject your scoped client, and then doing a request with additional headers and then you can check which headers were sent.

I'm not talking about integration, function or unit test case. I'm talking about manual testing to get the information first.

@OskarStark
Copy link
Contributor

I would think, the are merged and added if not present

@GrinWay
Copy link
Author

GrinWay commented Jan 16, 2025

I got it... of course commands

@GrinWay
Copy link
Author

GrinWay commented Jan 16, 2025

Currently (Symfony 7.2.2) it merges

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

No branches or pull requests

2 participants