mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-08-14 06:11:25 +00:00
Follow-up to #2514. The rebuilt handshake wrote the request line straight to the socket, so a header rejected by check_and_write_headers left a truncated "GET /ws HTTP/1.1" sitting in the peer's buffer before the connection was torn down, and every header cost its own small write. Build the request into a BufferStream and flush it in one go, matching ClientImpl::write_request. The new test drives a raw listener and asserts the peer sees a clean EOF with zero bytes; without this change it observes 18. Also fold WebSocketTest.HostHeaderInHandshake into WebSocketTest.DefaultHeadersInHandshake, which covers the same Host assertion through the capture helper #2514 introduced.