Skip to content

fix: handle HTTP/2 responses without a reason phrase in CURLRequest#10050

Merged
michalsn merged 4 commits intocodeigniter4:developfrom
michalsn:fix/phpstan
Mar 19, 2026
Merged

fix: handle HTTP/2 responses without a reason phrase in CURLRequest#10050
michalsn merged 4 commits intocodeigniter4:developfrom
michalsn:fix/phpstan

Conversation

@michalsn
Copy link
Member

Description
This PR fixes PHPStan errors, exposed here: https://github.com/codeigniter4/CodeIgniter4/actions/runs/23252730600/job/67598946599?pr=10049

Additionally, it fixes an issue in CURLRequest where HTTP/2 status lines without a reason phrase (e.g. HTTP/2 200) were not parsed correctly. This format is valid according to RFC 7540 and is used by curl for HTTP/2 and HTTP/3 responses.

The regex has been updated to make the reason phrase optional. The fallback value was also corrected from ?? null to ?? '' to match the string type expectation.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@michalsn michalsn added the bug Verified issues on the current code behavior or pull requests that will fix them label Mar 18, 2026
@michalsn michalsn merged commit fb4082d into codeigniter4:develop Mar 19, 2026
55 checks passed
@michalsn
Copy link
Member Author

Thanks for the reviews!

@michalsn michalsn deleted the fix/phpstan branch March 19, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Verified issues on the current code behavior or pull requests that will fix them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants