[Backport] Fixed curl adapter to properly set http version based on $http_ver argument #21550
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Original Pull Request
#21549
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 (*)