Duplicate data sent by compression middleware when no contentLength
Nek- opened this issue · comments
I found an issue in the CompressionMiddleware in the case of streaming a response with no content length.
The following line is filling the $bodyBuffer
variable:
While it's also done some lines after... Without cleaning the original var.
http-server/src/Middleware/CompressionMiddleware.php
Lines 195 to 197 in 850f1b2
I don't understand why it's done this way so I'm not sure I can provide a fix (something tells me it's not just stupid but has a purpose that I don't understand).
Does adding $promise = $body->read()
on line 144 fix the issue?
It seems to work properly with this change, yes!