Skip to content

Conversation

@ChiragAgg5k
Copy link
Member

Summary

  • Fixes "Array to string conversion" warning in Request::getSize() method when headers contain array values
  • After recent changes allowing array headers, the getSize() method needs to handle both string and array header values
  • Properly formats array headers as comma-separated values (standard HTTP format) before calculating request size

Changes

  • Updated Request::getSize() to handle array header values correctly
  • Added test case testCanGetSizeWithArrayHeaders() to verify the fix

Test plan

  • Added new test case for array headers
  • All existing RequestTest tests pass (26/26)
  • Verified no array to string conversion warning occurs

Headers can now be arrays (after recent changes allowing array headers).
The getSize() method was attempting to directly implode headers, causing
a warning when a header value was an array.

This fix properly handles both string and array header values by joining
array values with commas (standard HTTP header format) before calculating
the request size.

Added test case to verify the fix works correctly with array headers.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 11, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-array-header-size-calculation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ChiragAgg5k ChiragAgg5k merged commit 2c652b6 into 0.34.x Dec 11, 2025
5 checks passed
@ChiragAgg5k ChiragAgg5k deleted the fix-array-header-size-calculation branch December 11, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants