-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[HttpClient] Add option auto_upgrade_http_version to control how the request HTTP version is handled in HttplugClient and Psr18Client
#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 our terms of service and privacy 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 to
c9a4bbd
Compare
nicolas-grekas
left a comment
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.
Thanks, here are some suggestions
auto_upgrade_http_version to control how the request HTTP version is handled in HttplugClient and Psr18Client
|
|
||
| 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 version 1.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 see 2.0 or 3.0 here is on purpose too.
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 to
b6ac394
Compare
|
Thank you @ajgarlag. |
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.