Skip to content

Conversation

@clue
Copy link
Member

@clue clue commented Jun 25, 2025

This changeset fixes a warning when handling an HTTP request missing an Origin request header. A request without the required headers will not pass the OriginCheck, but it should not report a warning in either case. This is part 12 of reviving Ratchet as discussed in #1054, unblocking more future progress.

The code in question hasn't been touched in a while. This condition used to cause a notice in legacy PHP < 8 and a warning as of PHP 8+ (https://3v4l.org/8uKnY). Since adding full PHP 8+ support with #1094, we should properly handle this in either case. Similar to #1107 and others, this wasn't caught by the previous tests because the OriginCheck doesn't have full test coverage. I've updated the tests to ensure this should not happen again. The test suite confirms this now has full test coverage and does not otherwise affect any of the existing tests.

Overall, this required quite a massive effort. If you want to support this project, please consider sponsoring @reactphp ❤️

Builds on top of #1094, and others, one step closer to reviving Ratchet as discussed in #1054
Resolves / closes #954

@clue clue added this to the 0.4.5 milestone Jun 25, 2025
@clue clue requested a review from PaulRotmann June 25, 2025 14:59
Copy link
Contributor

@PaulRotmann PaulRotmann left a comment

Choose a reason for hiding this comment

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

👍

@PaulRotmann PaulRotmann merged commit c285cf9 into ratchetphp:0.4.x Jun 25, 2025
14 checks passed
@clue clue deleted the undefined-origin branch June 25, 2025 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OriginCheck - undefined key when no origin is specified in request header

2 participants