Add HTTP/3 protocol mapping to curl adapter - #19546
Open
masakielastic wants to merge 1 commit into
Open
Conversation
Map PSR-7 HTTP protocol versions 3 and 3.0 to CURL_HTTP_VERSION_3 and add test coverage.
Author
|
CakePHP's default PSR-7 request implementation relies on laminas/laminas-diactoros. The current Diactoros protocol-version validation rejects 3 and 3.0 before the request reaches the curl adapter. I opened an upstream pull request to add HTTP/3 protocol-version support: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Add support for mapping PSR-7 HTTP protocol versions
3and3.0toCURL_HTTP_VERSION_3in the curl HTTP client adapter.The adapter now throws an
HttpExceptionwith a descriptive message when the required curl constant is not available.Changes
3and3.0toCURL_HTTP_VERSION_3Testing
The HTTP/3 adapter test passes locally with PHP 8.6.0-dev and an HTTP/3-enabled curl build:
../php-src/sapi/cli/php -d zend.assertions=1 \ vendor/bin/phpunit \ tests/TestCase/Http/Client/Adapter/CurlTest.phpNotes
This change covers protocol-version mapping in the curl adapter. It does not perform a live HTTP/3 integration test.
CakePHP's default
Requestimplementation currently relies on Laminas Diactoros, which rejects protocol version3inwithProtocolVersion(). The test therefore uses a partial mock that returns3fromgetProtocolVersion().A full test-suite run with PHP 8.6.0-dev also reports an unrelated failure in:
No date, time, view helper, or internationalization files are changed by this pull request.