For Connect-protocol streaming responses, ServerStream treats the body ending without an END_STREAM envelope as a clean end of stream: message() returns Ok(None) and error() is None. A response that is cut off mid-stream (connection drop, misbehaving intermediary) is therefore indistinguishable from a complete one. The gRPC and gRPC-Web paths already surface missing trailers as an error, and connect-go reports a missing END_STREAM as an error as well.
Proposed work: when the body ends while the protocol is Connect and no END_STREAM envelope has been seen, surface an error (e.g. unavailable or internal, matching connect-go's choice) instead of a clean end, with a regression test for the truncated-response case.
For Connect-protocol streaming responses,
ServerStreamtreats the body ending without an END_STREAM envelope as a clean end of stream:message()returnsOk(None)anderror()isNone. A response that is cut off mid-stream (connection drop, misbehaving intermediary) is therefore indistinguishable from a complete one. The gRPC and gRPC-Web paths already surface missing trailers as an error, and connect-go reports a missing END_STREAM as an error as well.Proposed work: when the body ends while the protocol is Connect and no END_STREAM envelope has been seen, surface an error (e.g.
unavailableorinternal, matching connect-go's choice) instead of a clean end, with a regression test for the truncated-response case.