Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpClient] Add optionauto_upgrade_http_version to control how the request HTTP version is handled inHttplugClient andPsr18Client#62059
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
I have a few questions about the initial implementation:
Any proposal for a better option name is welcome too. |
6b92b39 toc9a4bbdCompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks, here are some suggestions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
auto_upgrade_http_version to control how the request HTTP version is handled inHttplugClient andPsr18Client| if ('1.0' ===$request->getProtocolVersion()) { | ||
| $options['http_version'] ='1.0'; | ||
| if (!$this->autoUpgradeHttpVersion ||'1.0' ===$request->getProtocolVersion()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Should we deprecate the exceptional behavior for version1.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I wouldn't: all PSR-7 implementations default to 1.1, so if we see 1.0 here, it's on purpose.
Also no need to change something that ain't bokrne :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
So if we see2.0 or3.0 here is on purpose too.
nicolas-grekasOct 14, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Well, I'd consider explicit HTTP version selection something of the past - TLS negotiation makes it mostly useless.
I wouldn't change. The option you added is fine to reclaim control for use cases that care.
…e request HTTP version is handled in `HttplugClient` and `Psr18Client`
a4c62dd tob6ac394CompareThank you@ajgarlag. |
ad0a07c intosymfony:7.4Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
When a PSR-7 request is sent using
Psr18Client, the PSR-7 request protocol version is only converted to the underlyinghttp_versionoption when is set to1.0, so we cannot control that option for1.1or2.0.I have a project where I need to dynamically force the use of protocol version
1.1but the final request is always sent using version2.0.This PR add option
auto_upgrade_http_versionto control how the request HTTP version is handled inHttplugClientandPsr18Client.