Skip to content

Conversation

@mathieucarbou
Copy link
Member

@mathieucarbou mathieucarbou commented Jan 1, 2026

See: #349

Fix bug for non-chucked responses without a known content-length (see LargeResponse example)

These use cases:

curl -v http://192.168.4.1/2 | grep -o '.' | sort | uniq -c

and

curl -v http://192.168.4.1/3 | grep -o '.' | sort | uniq -c

were not working anymore.

See: #349

Fix bug for non-chucked responses without a known content-length (see LargeResponse example)
Copilot AI review requested due to automatic review settings January 1, 2026 15:37
@mathieucarbou mathieucarbou self-assigned this Jan 1, 2026
@mathieucarbou mathieucarbou requested review from me-no-dev, vortigont and willmmiles and removed request for Copilot January 1, 2026 15:37
Copilot AI review requested due to automatic review settings January 1, 2026 15:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a critical bug introduced in PR #349 that broke non-chunked HTTP responses without a known content-length. The fix adds conditional logic to handle both known and unknown content-length scenarios correctly.

Key Changes:

  • Added conditional check to differentiate between responses with known vs. unknown content-length
  • Refactored the buffer size calculation to prevent underflow when _contentLength is 0
  • Added explanatory comments describing the two response scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mathieucarbou mathieucarbou merged commit 08763f3 into main Jan 1, 2026
47 of 71 checks passed
@mathieucarbou mathieucarbou deleted the fix-349 branch January 1, 2026 23:30
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.

3 participants