amphp / http-server

An advanced async HTTP server library for PHP, perfect for real-time apps and APIs with high concurrency demands.
https://amphp.org/http-server
MIT License
1.29k stars 100 forks source link

Fix: avoid duplicated data for streamed response #342

Closed Nek- closed 1 year ago

Nek- commented 1 year ago

In the case of a streamed response, the content-length is null, so the bodyBuffer is filled at some point.

The problem is that some lines after it's filled again with the same data, lead to duplication (only for the first bytes).

This fix has been suggested by @trowski in #341 .

This PR fixes #341

trowski commented 1 year ago

Thanks!