You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Explicitly close connection after response body to support servers ignoring Connection: close request header #102
The only problem is that \React\Promise\Stream\buffer doesn't resolve when maxLength is reached and changing it to resolve would be a BC break. We'd have to roll our own or start a discussion over on https://github.com/reactphp/promise-stream about adding a $resolveOnMaxLengthReached flag or something.
That being said, I agree that this is something we should support nonetheless. The implementation likely depends on reactphp/http-client#92 being addressed first. Once that PR is in, this should be trivial here.
changed the title [-]Respect content-length to prevent indefinite buffering[/-][+]Explicitly close connection after response body to support servers ignoring Connection: close request header[/+]on Jul 30, 2018
Activity
clue commentedon Jul 30, 2018
@jmoo This is an interesting issue!
The server is clearly at fault for violating HTTP specs here: https://tools.ietf.org/html/rfc7230#section-6.3
That being said, I agree that this is something we should support nonetheless. The implementation likely depends on reactphp/http-client#92 being addressed first. Once that PR is in, this should be trivial here.
[-]Respect content-length to prevent indefinite buffering[/-][+]Explicitly close connection after response body to support servers ignoring Connection: close request header[/+]bartvanhoutte commentedon Apr 28, 2020
Seems like I'm running into this as well. Any workarounds for the moment?
jmoo commentedon Apr 28, 2020
This was a couple of years ago but at the time I just ended up handling the buffering manually:
https://github.com/jmoo/chrome-reactphp/blob/04340bdb1f0a0371ee21dc2bc30fc12a0ec0ab1b/src/Async/Client.php#L118
bartvanhoutte commentedon Apr 28, 2020
@jmoo just implemented something similar.
clue commentedon May 5, 2020
Finally fixed via #161, please let me know if this works for you 👍
Thanks for reporting and for the possible workaround!