grpc / grpc/grpc-web

Response parsing breaks with 'grpc-encoding: gzip'

Open
#561 16 comments 7 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
9.3k
Forks
802
Avg merge
1d 7h
Merged PRs (30d)
5

Description

When the gRPC response is gzipped (indicated by the `grpc-encoding: gzip` response header), the grpc-web stream parser fails with this error (including the first few bytes for reference):

```
Uncaught Error: The stream is broken @0/0. Error: invalid frame byte. With input:
1,0,0,2,126,31,...
```

And the grpc-web filter in Envoy unfortunately automatically adds this request header when proxying to the gRPC server: `grpc-accept-encoding:identity,deflate,gzip`, which in the case of akka-grpc at least causes the server to gzip. The envoy source code has a comment stating that this header 'is required for gRPC'.

When I hacked akka-grpc to ignore the above header and not gzip, the response is properly parsed.

I'm a backend engr., but if someone can give me some pointers I could take a stab at fixing this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.