mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 20:39:05 +00:00
Fixed two more potentially flaky tests that were resolving on first data chunk instead of waiting for complete HTTP responses: 1. Basic HTTP request test: - Now parses Content-Length header - Waits until full response body is received before resolving - Adds close handler as fallback for Connection: close 2. Keep-Alive multiple requests test: - Implements proper HTTP response parser that handles pipelined responses - Maintains buffer and extracts complete responses one at a time - Supports multiple responses in single data chunk - Each response is pushed to array only when complete (headers + body) - Properly handles Connection: close by pushing remaining buffer Both tests now robustly handle: - Multi-chunk responses - Pipelined responses - Content-Length parsing - Connection close scenarios All 7 tests pass with 281 expect() calls. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>