Skip to content
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

grpc-web: trailers message is not being decompressed when compressed bit is set #2593

Open
jhump opened this issue Feb 13, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@jhump
Copy link
Member

jhump commented Feb 13, 2025

The final message in a grpc-web response stream has a special bit set that indicates it contains trailers. If the header byte for that message has both the "compressed" and "trailers" bits set, the compressed flag is effectively ignored. It attempts to parse the compressed data, which of course results in an error:

InvalidOperationException: Error parsing badly formatted trailing header.

Having both bits set is definitely valid per the protocol. The protocol spec even has exactly this combination in the examples for header byte.

@jhump jhump added the bug Something isn't working label Feb 13, 2025
@jhump jhump changed the title grpc-web: trailers message is not being decompress is compressed bit is set grpc-web: trailers message is not being decompressed when compressed bit is set Feb 13, 2025
@jhump
Copy link
Member Author

jhump commented Feb 13, 2025

@sudorandom created a repro case for this bug here: https://github.com/sudorandom/dotnet-grpc-compress-bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant