8000 [HttpClient] Remove final keyword on `AsyncResponse` by lyrixx · Pull Request #50577 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpClient] Remove final keyword on AsyncResponse #50577

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

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

lyrixx
Copy link
Member
@lyrixx lyrixx commented Jun 6, 2023
Q A
Branch? 6.3
Bug fix? kind of
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

In symfony < 6.3, it was possible to override HTTP response headers. See this blog post for a use case

With Symfony 6.3, this is not possible anymore. I created a reproducer here: https://github.com/lyrixx/test/tree/http-cache-pp

And @nicolas-grekas came with another solution: lyrixx/test#11

So here we go!

@stof
Copy link
Member
stof commented Jun 6, 2023

Doesn't this risk breaking concurrency features of support for streaming chunks ? The override of headers is probably the only use case for which extending AsyncResponse is a working solution.

So if we don't make AsyncResponse final anymore, maybe a bunch of its methods should become final instance, to prevent overriding them by thinking that it will work while it would break half of the ways the client can be used. Any of the methods dealing with the content cannot be used to implement additional logic without breaking the streamed usage.

@nicolas-grekas
Copy link
Member
nicolas-grekas commented Jun 6, 2023

Let's make getContent , toArray and toStream final? The rest should be fine being extended.

@lyrixx
Copy link
Member Author
lyrixx commented Jun 7, 2023

@nicolas-grekas done ✅

@lyrixx lyrixx force-pushed the http-client-no-final branch from cf01e19 to dc727d3 Compare June 7, 2023 08:46
@OskarStark OskarStark changed the title [HttpClient] Remove final keyword on AsyncResponse [HttpClient] Remove final keyword on AsyncResponse Jun 7, 2023
@lyrixx lyrixx force-pushed the http-client-no-final branch from dc727d3 to fbd6d18 Compare June 9, 2023 09:04
@nicolas-grekas
Copy link
Member

Thank you @lyrixx.

@nicolas-grekas nicolas-grekas merged commit d9a8902 into symfony:6.3 Jun 9, 2023
@lyrixx lyrixx deleted the http-client-no-final branch June 9, 2023 09:07
@fabpot fabpot mentioned this pull request Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0