Closed hijamoya closed 5 years ago
In grpc gateway 1.7, the pb.gw.go file
dec := marshaler.NewDecoder(req.Body)
change to
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, berr
}
dec := marshaler.NewDecoder(newReader())
makes the response can not be delivered.
Hm, is the problem that it's no longer streaming the request body? It tries to read the whole thing? This could potentially be fixed with an *io.Pipe
in the grpc-gateway.
The reason this function was introduced was because we needed a way to read the body several times. There may be a way to have both streaming of the body and the ability to read-from-the-start with some experimentation. It might be worth raising a bug in grpc-gateway if you can nail down exactly why this happened (but I suspect it's the ReadAll
call blocking the request body).
I think we can close this in favor of https://github.com/grpc-ecosystem/grpc-gateway/issues/894.
Works great before upgrading. After upgrading, the client can not receive the streaming response.