Skip to content

Commit

Permalink
Only disable chunked http encoding if we are not using streams
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelAquilina committed Jun 7, 2019
1 parent 1860f23 commit edc76b2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/grpc-web-node-http-transport/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ class NodeHttp implements grpc.Transport {
}

sendMessage(msgBytes: Uint8Array) {
this.request.setHeader("Content-Length", msgBytes.byteLength);
if (!this.options.methodDefinition.requestStream) {
// Disable chunked encoding if we are not using streams
this.request.setHeader("Content-Length", msgBytes.byteLength);
}
this.request.write(toBuffer(msgBytes));
this.request.end();
}
Expand Down

0 comments on commit edc76b2

Please sign in to comment.