Skip to content
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

Consistent parsing for HTTP CONNECT request method (PHP SAPI) #255

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

clue
Copy link
Owner

@clue clue commented Apr 12, 2024

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 a 400 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

@clue clue added the new feature New feature or request label Apr 12, 2024
@clue clue requested a review from SimonFrings April 12, 2024 20:44
@clue clue added this to the v0.17.0 milestone Apr 12, 2024
Copy link
Contributor

@SimonFrings SimonFrings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's get this in 👍

@SimonFrings SimonFrings merged commit 6ee8435 into clue:main Apr 15, 2024
60 checks passed
@SimonFrings SimonFrings deleted the connect-request branch April 15, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants