-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explicitly close connection after response body to support servers ignoring Connection: close request header #102
Comments
@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. |
Seems like I'm running into this as well. Any workarounds for the moment? |
This was a couple of years ago but at the time I just ended up handling the buffering manually: |
@jmoo just implemented something similar. |
Finally fixed via #161, please let me know if this works for you 👍 Thanks for reporting and for the possible workaround! |
Some HTTP/1.1 servers do not honor the
Connection: Close
header. bufferResponse will never resolve when making requests to these.Here is an example fix:
jmoo@a9c27ec
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.Related to #89
The text was updated successfully, but these errors were encountered: