-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Fixed curl adapter to properly set http version based on $http_ver argument #21549
Fixed curl adapter to properly set http version based on $http_ver argument #21549
Conversation
…s to prevent failure when requesting from http2 capable endpoint
Hi @davidalger. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
Hi @davidalger. Have just checked a few HTTP/2 implementations using |
Hi @rogyar, thank you for the review. |
@rogyar Thanks for looking at this. My bad on the testing scenario…the exception only occurs when this adapter is used by the zend client, so to reproduce the issue described, run the following code from a system with HTTP/2 curl libraries present.
Before the fix on this PR, the above will result in the following error:
As long as curl is loaded, I'll update my steps to test the issue to reflect the above code snippet and more clearly state that reproducing the issue requires using the adapter from within the zend client. |
QA passed. |
Hi @davidalger, thank you for your contribution! |
… $http_ver argument #21549
Can we merge this into 2.2.x? Same issue there and the patch works for me on 2.2.9. |
Thank you! |
Description (*)
The curl HTTP adapter currently does not respect the value of the
$http_ver
argument to thewrite
method causing\Magento\Framework\HTTP\ZendClient
to throw an exception causing a fatal error when making a request to an HTTP/2 capable server from a client server that has HTTP/2 curl libraries loaded.Fixed Issues (if relevant)
Manual testing scenarios (*)
Use
\Magento\Framework\HTTP\ZendClient
to make a request to an HTTP/2 capable endpoint from a system with HTTP/2 enabled curl libraries. Without this change in place, the client will fail to parse the response headers because the regex found in\Zend_Http_Response::extractHeaders
is specifically expectingHTTP 1.1
orHTTP 1.0
in the response.To reproduce the issue, the following code snippet may be used:
Contribution checklist (*)