Consistent parsing for HTTP CONNECT
request method (PHP SAPI)
#255
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.
This changeset improves consistency when parsing incoming HTTP proxy requests using the
CONNECT
request method when using the PHP SAPI. We already reject any such requests with a400 Bad Request
error response consistently (see #46). On top of this, we now also consistently parse the request URI in case the request will be processed through any global request middleware handlers. This does not otherwise affect our public API and comes with full code coverage, so this should be safe to apply.In particular, ReactPHP now ships a new PSR-7 implementation and no longer uses the dated RingCentral PSR-7 implementation. The updated tests are now in line with the requirements outlined by PSR-7 which are now properly enforced via reactphp/http#521 and reactphp/http#522. Specifically, a
CONNECT
request now uses a request URI with the appropriate scheme specified. The previous test used incorrect assumptions provided by the dated RingCentral PSR-7 implementation and has been in place ever since #46 has been merged several years ago.Builds on top of #46, reactphp/http#521, reactphp/http#201, reactphp/http#158 and others